在真实设备(iPhone 7)上运行测试脚本时,我遇到了以下问题。看到那个日志后,我试着解决这个问题,但我卡在这里(查看截图)
环境 - APPI - 1.8.0-β3设备 - iPhone 7(OS - 10.3.1)的Mac OS - 10.13.2
Appium Log -
[Appium] Welcome to Appium v1.8.0-beta3
[Appium] Non-default server args:
[Appium] port: 5488
[Appium] Appium REST http interface listener started on 0.0.0.0:5488
[HTTP] --> GET /wd/hub/status {}
[debug] [MJSONWP] Calling AppiumDriver.getStatus() with args: []
[debug] [MJSONWP] Responding to client with driver.getStatus() result: {"build":{"version":"1.8.0-beta3","revision":null}}
[HTTP] <-- GET /wd/hub/status 200 23 ms - 78
Attempt[1] to start appium server
[HTTP] --> GET /wd/hub/status {}
[debug] [MJSONWP] Calling AppiumDriver.getStatus() with args: []
[debug] [MJSONWP] Responding to client with driver.getStatus() result: {"build":{"version":"1.8.0-beta3","revision":null}}
[HTTP] <-- GET /wd/hub/status 200 15 ms - 78
[HTTP] --> GET /wd/hub/status {}
[debug] [MJSONWP] Calling AppiumDriver.getStatus() with args: []
[debug] [MJSONWP] Responding to client with driver.getStatus() result: {"build":{"version":"1.8.0-beta3","revision":null}}
[HTTP] <-- GET /wd/hub/status 200 15 ms - 78
[HTTP] --> POST /wd/hub/session {"desiredCapabilities":{"noReset":false,"clearSystemFiles":true,"newCommandTimeout":1200,"platformVersion":"10.3.1","automationName":"XCuiTest","bundleId":"--------","udid":"457187374caf18----------------------------------","platformName":"iOS","deviceName":"iOS"},"requiredCapabilities":{},"capabilities":{"desiredCapabilities":{"noReset":false,"clearSystemFiles":true,"newCommandTimeout":1200,"platformVersion":"10.3.1","automationName":"XCuiTest","bundleId":"-----------","udid":"457187374caf18----------------------------------","platformName":"iOS","deviceName":"iOS"},"requiredCapabilities":{},"alwaysMatch":{"platformName":"iOS"},"firstMatch":[]}}
[debug] [MJSONWP] Calling AppiumDriver.createSession() with args: [{"noReset":false,"clearSystemFiles":true,"newCommandTimeout":1200,"platformVersion":"10.3.1","automationName":"XCuiTest","bundleId":"-----------","udid":"457187374caf18----------------------------------","platformName":"iOS","deviceName":"iOS"},{},{"desiredCapabilities":{"noReset":false,"clearSystemFiles":true,"newCommandTimeout":1200,"platformVersion":"10.3.1","automationName":"XCuiTest","bundleId":"-----------","udid":"457187374caf18----------------------------------","platformName":"iOS","deviceName":"iOS"},"requiredCapabilities":{},"alwaysMatch":{"platformName":"iOS"},"firstMatch":[]}]
[debug] [BaseDriver] Event 'newSessionRequested' logged at 1519049570375 (19:42:50 GMT+0530 (IST))
[Appium] Could not parse W3C capabilities: 'deviceName' can't be blank. Falling back to JSONWP protocol.
[Appium] Creating new XCUITestDriver (v2.68.0) session
[Appium] Capabilities:
[Appium] noReset: false
[Appium] clearSystemFiles: true
[Appium] newCommandTimeout: 1200
[Appium] platformVersion: 10.3.1
[Appium] automationName: XCuiTest
[Appium] bundleId: -----------
[Appium] udid: 457187374caf18----------------------------------
[Appium] platformName: iOS
[Appium] deviceName: iOS
[debug] [BaseDriver]
[debug] [BaseDriver] Creating session with MJSONWP desired capabilities: {"noReset":false,"clearSyst...
[BaseDriver] Session created with session id: 431df073-2efd-4f7f-b9c6-9868cc1d87d6
[debug] [XCUITest] Current user: 'test'
[debug] [XCUITest] Xcode version set to '9.2'
[debug] [XCUITest] iOS SDK Version set to '11.2'
[debug] [BaseDriver] Event 'xcodeDetailsRetrieved' logged at 1519049570723 (19:42:50 GMT+0530 (IST))
[XCUITest] The 'idevice_id' program is not installed. If you are running a real device test it is necessary. Install with 'brew install libimobiledevice --HEAD'
[debug] [XCUITest] Available devices:
[XCUITest] Error: Unknown device or simulator UDID: '457187374caf18----------------------------------'
在终端上运行这些命令
brew uninstall ideviceinstaller
brew uninstall --ignore-dependencies libimobiledevice
brew install --HEAD libimobiledevice
brew unlink libimobiledevice && brew link libimobiledevice
brew install --HEAD ideviceinstaller
brew unlink ideviceinstaller && brew link ideviceinstaller