So I'm trying to run few tests on physical iPhone - but for some reason it's not working. Works correctly on build in Xcode iPhones Simulator, Android Simulator and real Android device - it's only issue with iPhone real device. ios-deploy is seeing connected device but seems like Appium at first sees the device but then can't connect to it because it can't find "pair record for device" (whatever that means).
Error message returned by Appium: Error: Couldn't find a pair record for device 00008030-000A11413E00802A. Please first pair with the device
Here are logs with mentioned error:
[XCUITest] Available devices: 00008030-000A11413E00802A
[XCUITest] Creating iDevice object with udid '00008030-000A11413E00802A'
[XCUITest] Getting the platformVersion from the phone since it was not specified in the capabilities
[XCUITest] Determining device to run tests on: udid: '00008030-000A11413E00802A', real device: true
[XCUITest] Normalized platformVersion capability value '13.2.0' to '13.2'
[BaseDriver] Event 'xcodeDetailsRetrieved' logged at 1578909419779 (10:56:59 GMT+0100 (CET))
[BaseDriver] Event 'appConfigured' logged at 1578909419780 (10:56:59 GMT+0100 (CET))
[BaseDriver] Event 'resetStarted' logged at 1578909419780 (10:56:59 GMT+0100 (CET))
[XCUITest] Reset: running ios real device reset flow
[BaseDriver] Event 'resetComplete' logged at 1578909419780 (10:56:59 GMT+0100 (CET))
[XCUITest] Continuing without capturing device logs: Couldn't find a pair record for device 00008030-000A11413E00802A. Please first pair with the device
[XCUITest] Setting up real device
[XCUITest] Error: Couldn't find a pair record for device 00008030-000A11413E00802A. Please first pair with the device
[XCUITest] at startLockdownSession (/Applications/Appium.app/Contents/Resources/app/node_modules/appium-ios-device/lib/utilities.js:108:13)
[DevCon Factory] Releasing connections for 00008030-000A11413E00802A device on any port number
[DevCon Factory] No cached connections have been found
[BaseDriver] Event 'newSessionStarted' logged at 1578909419790 (10:56:59 GMT+0100 (CET))
[MJSONWP] Encountered internal error running command: Error: Couldn't find a pair record for device 00008030-000A11413E00802A. Please first pair with the device
Does anyone know what's the issue here and how can I solve it?
So, it turned out all I had to do was to install idevicepair (it comes bundled within libimobiledevice). So all I had to do was to:
brew install libimobiledevice
Verify that idevicepair is correctly installed and it sees your connected iPhone with:
idevicepair list
After everythings good you can pair your device with
idevicepair --udid [here goes UDID of your iPhone] pair
This worked for me :)