-
Notifications
You must be signed in to change notification settings - Fork 5
iOS Remote Debugging Setup on PC
While it seems that one cannot build and deploy a Unity project targeting iOS to an actual test bench on a PC (it only generates what seems to be an XCode project, which needs to be opened and built with XCode on a Mac), it is still possible to do some remote debugging using the Unity Remote utility. This guide aims to document the perquisites and steps needed to get iOS remote debugging working on a PC.
It seems that getting Unity Remote to work is really a hit-and-miss, so your mileage may vary.
- Unity Editor with iOS build support
- iTunes for Windows (see troubleshooting for details)
- Unity Remote app installed on your iOS test bench
To check whether your Unity Editor has iOS build support, open Unity Hub and go to the "Installs" section. You should see your Unity Editor install listed with an array of symbols indication the various features supported:
If you have the "iOS" symbol, then you are all set. If not, click the handle on the upper-right corner, and go to "Add Modules" to install iOS Build Support.
Open your Unity project, go to File - Build Settings, and verify that your project is targeting iOS.
If not, then make sure you have checked out the correct branch, or you can select the iOS option and click the "Switch Platform" button.
Once it is all set, connect your iOS device to your PC, and if you are prompted whether to trust this PC, select "Yes" and enter your passcode if applicable.
Then open up Unity Remote on your iOS device, close the Build Settings Screen, and go to Edit - Project Settings - Editor in your Unity Editor.
Under the Unity Remote - Devices menu, select either "Any iOS Device" or the name of the iOS device you have just plugged in, and set Joystick Source to the "Remote" option. Then close the Project Settings screen.
Now click the "Play" button on the main UI, and if all is well, you should see the game running on your iOS device.
Try restarting Unity Editor and Unity Remote, and try rebooting the PC. If this still does not work, try reconnecting your iOS device and make sure you have trusted the PC. You may also need to wait for Windows Update to finish installing the required drivers. If it still does not work, read the "Note on iTunes version selection" section.
This is normal. You are essentially "streaming" the game onto the iOS device via the USB interface, like using a remote desktop connection or screen sharing. The game will run at full speed once it is compiled and deployed to the target device.
iTunes for Windows comes in two versions: a "traditional" version that is downloaded directly from Apple, and a "store" version that is distributed through the Microsoft Store. It seems that the two versions ships with different drivers: The former version ships with a standalone driver package, and the latter comes with no drivers by default. For the "store" version, drivers are automatically downloaded by Windows through Windows Update when iOS devices are connected. It is known that the former version of drivers can interfere with the sleep functions on Windows machines that support what Microsoft terms as "Modern Standby" or S0 low power idle mode (namely, Microsoft Surface devices and some later ThinkPads, but there are more). Therefore, it is always recommended to install iTunes from Microsoft Store, and if it does not work, follow these steps:
- Open an Admin Command Prompt, and execute
powercfg /a
- Make sure that your machine has "S3" but not "S0 low power idle" listed as supported
- Uninstall the iTunes installed through Microsoft Store, and re-install it directly from Apple
- Unity Remote 5 on App Store: https://apps.apple.com/us/app/unity-remote-5/id871767552
- iTunes on Microsoft Store: https://www.microsoft.com/en-us/p/itunes/9pb2mz1zmb1s
- iTunes download from Apple: https://www.apple.com/itunes/