Testing on a real iOS device

App testing on the iOS Simulator is quick and easy, but sometimes it is required to run a test using a real device connected to the machine running the iOS test. To run iOS tests on a real device, several requirements need to be fulfilled:

  1. The system has to be prepared as described in section 17.2, including a complete installation of Xcode.
  2. The Developer Mode must be enabled on the device in »Xcode«-»Settings«-»Privacy & Security«.
  3. The device has to be connected to the machine, and the machine has to be marked as "trusted" on the device.
  4. The device must be unlocked during testing.
  5. A developer account must be added in »Xcode«-»Settings…«-»Accounts« using its Apple ID.
  6. The team ID corresponding to the selected developer account must be provided using the option 'Code Signing Team ID / Organizational Unit'.
  7. Sometimes, the first test start fails due to missing profile trust on the device. To trust the developer profile, open the Settings app and on the device navigate to »General«-»VPN & Device Management« or »Profiles« and confirm the trust there.
  8. Figure 17.5:  Navigate to the iOS profile trust section
  9. Applications, which are installed on the device during the test must be available in a version build for "Any iOS device" (which is another build target than "Any iOS Simulator"), and properly signed. As well, a provisioning profile must be installed on the device allowing the application to be run (see Apple documentation).