Connecting iOS devices
Connecting your iOS device
To connect an iOS device, such as an iPhone or iPad, to your Device Hub, follow these steps:
- Make sure your iOS devices is turned, fully charged and unlocked.
- Connect your iOS device to your Device Hub using an USB cable.
- When the Trust this Device pop-up appears on your iOS device, click Trust. It can take up to one minute for your iOS device and Device Hub to initiate the pairing process.
- On the Device Hub, navigate to http://localhost:17894/ and click the Devices tab. Your device is now visible.
- Click your device, and click Remote Screen. You will now see a mirror of the device screen on your PC.
Enabling automation on your iOS device
Once your device is connected to your Device Hub, follow these steps to configure your device:
- Press the Home button and then tap Settings. Scroll down to and tap Developer and check Enable UI Automation.
- Go back to the Settings screen and tap Safari. Scroll down to the bottom of the page and tap Advanced
- Make sure the Web Inspector toggle is enabled.
If you do not see the Developer option in the Settings screen, open the Remote screen for your device by following the steps in the previous section.
Prepare your device for continuous automation
You can now fine-tune your device for continuous automation. When your device runs continuously, you want to make sure your device does not drain the battery and does not automatically lock itself. Both a drained battery and a locked device would prevent your tests from running on your device.
The main consumer of battery power is your device screen. To configure your screen, perform these steps on your device:
- Press the Home button and then tap Settings. Tap Display & Brightness.
- Set the Brightness level to minimal.
- Set Auto-Lock to Never.
Troubleshooting iOS device connections
If your iOS device does not appear:
- Run the
lsusbcommand in a shell session in your Device Hub. This will list all USB devices which are connected to your Device Hub. If you do not see your device in this list, check the USB connection between your device and the Device Hub.
- Run the
idevice_id -lcommand in a shell session in your Device Hub. This will list all iOS device connected to your Device Hub. If you do not see your device in this list, try unplugging your device and connecting your device again.
- You can force your device to reset the trust relationship between your device and all other devices, including the Device Hub, by tapping Settings, General, Reset and choosing Reset Location & Privacy. Then, enter your passcode if required and tap Reset Settings to confirm. Finally, unplug the USB cable and then reattach the USB cable to your Device Hub.