找不到设备的配对记录...-尝试将 Appium 连接到真实设备时出现问题 iPhone / Appium 无法连接到真实设备 iPhone

Couldn't find a pair record for device ... - problem when trying to connect Appium to real iPhone device / Appium can't connect to real iPhone

所以我正在尝试 运行 一些物理测试 iPhone - 但由于某些原因它不起作用。 在 Xcode iPhones 模拟器、Android 模拟器和真实 Android 设备中正常运行 - 这只是 iPhone 真实设备的问题。 ios-deploy 看到已连接的设备,但 Appium 起初似乎看到了该设备,但随后无法连接到它,因为它找不到 "pair record for device"(无论那是什么意思)。

Appium返回的错误信息: 错误:找不到设备 00008030-000A11413E00802A 的配对记录。请先与设备配对

以下是包含上述错误的日志:

[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

有谁知道这是什么问题,我该如何解决?

所以,事实证明我所要做的就是安装 idevicepair(它捆绑在 libimobiledevice 中)。所以我所要做的就是:

brew install libimobiledevice

验证 idevicepair 是否已正确安装,它会看到您的连接 iPhone 与:

idevicepair list

一切正常后,您可以将您的设备与

配对
idevicepair --udid [here goes UDID of your iPhone] pair

这对我有用:)