So,why would you need to debug iOS apps remotely? Well, if you have the target iOS device around and can connect it directly to your development machine, you have nothing to worry about. But what if you needed to test a program running on a remote device which couldn’t be physically attached to your development computer?
The native solution for remote iOS debugging
Probably the simplest way to debug iOS apps on a remote device is the new option presented in Xcode 9 awhile back. It relieves you of the need to plug the device into your Mac any time you want to debug your iOS application. As for the weaknesses of this option:
- To be able to debug your iOS app remotely, you’ll still need to physically connect the iOS device to your development machine at least once (to setup remote debugging).
- Mac with running Xcode and the device you want to access remotely must be located within the same local network. If not, remote iOS debugging simply won’t work.
As an alternative to the native method, you may also consider using a third-party solution like FlexiHub. This software tool is designed to redirect iOS devices across any network and any distance.
FlexiHub: an advanced software for remote access to iOS devices
FlexiHub is a dedicated software solution that allows forwarding iPhones, iPads and iPods over the Internet so that programmers (as well as ordinary users) can access them remotely. The software is based on a unique port virtualization technology, which means it can easily create an unlimited number of virtual USB interfaces.
To access and debug you iOS app remotely, you just need to follow these simple steps:
- First of all, create a FlexiHub account and start a free trial.
- Then, install FlexiHub on your local computer running the debugger and a remote machine where an iOS device (with the app you need to debug) is connected physically.
- Launch the utility on the local computer and log into the newly-created account.
- After that, start FlexiHub on the remote side and sign into the same software account. Once done, you’ll see the iOS device in the list of devices available for connection.
- Click “Connect”.
Here you go! Now, the remote iPhone, iPad, or iPod will become connected to your Mac as if it were directly connected to it.
If you would like to go with method available in Xcode, below you’ll find a brief step-by-step instruction.
How to remotely debug iOS app with Xcode 9
Before you start, make sure that you’re running Xcode 9.0 +, macOS 10.12.4 +, and iOS 11.0 +. Otherwise, remote debugging simply won’t work.
To set up iPhone, iPad, or iPod touch, do the following:
- Open your project in Xcode.
- Choose Window > Devices and Simulators.
- In the invoked window, hit “Devices”.
- Connect the required device to your machine using a USB cable.
- Select this device in the left column and enable “Connect via network” in the detail area.
- Starting from this moment, Xcode will pair with your device. If the connection is successful, you’ll see a network icon next to the device in the left column.
- Disconnect the device.
This is it! Now, you can debug your iOS apps via a remote connection.