Appium Appium 1.6.3 [XCUITest] Unable to start WebDriverAgent: Error

大王命我来巡山 · 2016年12月27日 · 最后由 Unmurphy 回复于 2017年03月20日 · 3598 次阅读

环境:电脑--mac npm 下载 appium1.6.3 手机--iphone6s ios9.3.5
命令行打开 appium 运行脚本总是报这个错 请问有谁遇到过吗
报错附近 log

[XCUITest] Launching WebDriverAgent on the device
[debug] [XCUITest] Carthage found: /usr/local/bin/carthage
[debug] [XCUITest] Killing hanging processes
[debug] [XCUITest] Using real device logger 'idevicesyslog'
[debug] [XCUITest] Beginning test with command 'xcodebuild build test -project /usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -destination id=842c6615c76e1d00caf8a010e70feb40ce1c95ba -configuration Debug' in directory '/usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent'
[XCUITest] Unable to start WebDriverAgent: Error: Command 'idevicedate -u 842c6615c76e1d00caf8a010e70feb40ce1c95ba' exited with code 255
[XCUITest] Unable to start WebDriverAgent: Error: Command 'idevicedate -u 842c6615c76e1d00caf8a010e70feb40ce1c95ba' exited with code 255
[XCUITest] Shutting down sub-processes
[debug] [XCUITest] Running ios real device reset flow
[debug] [XCUITest] Resetting simulator
[debug] [iOSLog] Stopping iOS log capture
[MJSONWP] Encountered internal error running command: undefined
[HTTP] <-- POST /wd/hub/session 500 1862 ms - 262 

还有就是 log 开头很多 null 有关系吗 如下

[debug] [MJSONWP] Calling AppiumDriver.createSession() with args: [{"deviceName":"iPhone 6s","udid":"842c6615c76e1d00caf8a010e70feb40ce1c95ba","automationName":"XCUITest","platformVersion":"9.3.5","platformName":"ios","bundleId":"com.xxxxxxxxxxxxx.test"},{},null,null,null,null,null,null,null,null,null,null,null,null,null]
共收到 17 条回复 时间 点赞

idevicedate -u 842c6615c76e1d00caf8a010e70feb40ce1c95ba 执行下这个命令看看

#1 楼 @Lihuazhang 忘了说 执行过了 提示 ERROR: Could not connect to lockdownd, error code -21

lockdownd 服务挂了,想办法启动

#3 楼 @Lihuazhang 需要 手机越狱吗?!

#4 楼 @y693055797 不需要,有可能就是这服务没起来,重启手机试试看

你用的是不是 iOS10
执行下:
brew install libimobiledevice --HEAD

应该是你装的 libimobiledevice 不支持 iOS10

#6 楼 @iriszhang @Lihuazhang 这个搞定了 但是又出现 Webdriveragent 的错误


[Xcode] 2016-12-29 11:43:10.038 XCTRunner[596:89986] Running tests...
2016-12-29 11:43:10.082 XCTRunner[596:89986] The bundle “WebDriverAgentRunner” couldn’t be loaded because it is damaged or missing necessary resources. Try reinstalling the bundle.
2016-12-29 11:43:10.082 XCTRunner[596:89986] (dlopen_preflight(/var/containers/Bundle/Application/5C49AB64-47A9-4DD5-8801-8715EB8B0198/WebDriverAgentRunner-Runner.app/PlugIns/WebDriverAgentRunner.xctest/WebDriverAgentRunner): Library not loaded: @rpath/Peertalk.framework/Peertalk
  Referenced from: /private/var/containers/Bundle/Application/5C49AB64-47A9-4DD5-8801-8715EB8B0198/WebDriverAgentRunner-Runner.app/PlugIns/WebDriverAgentRunner.xctest/Frameworks/WebDriverAgentLib.framework/WebDriverAgentLib
  Reason: no suitable image found.  Did find:
    /private/var/containers/Bundle/Application/5C49AB64-47A9-4DD5-8801-8715EB8B0198/WebDriverAgentRunner-Runner.app/PlugIns/WebDriverAgentRunner.xctest/Frameworks/WebDriverAgentLib.framework/Frameworks/Peertalk.framework/Peertalk: mmap() error 1 at address=0x102198000, size=0x00010000 segment=__TEXT in Segment::map() mapping /private/var/containers/Bundle/Application/5C49AB64-47A9-4DD5-8801-8715EB8B0198/WebDriverAgentRunner-Runner.app/PlugIns/WebDriverAgentRunner.xctest/Frameworks/WebDriverAgentLib.framework/Frameworks/Peertalk.framework/Peertalk)

[XCUITest] xcodebuild exited with code '65' and signal 'null'
[XCUITest] Error: xcodebuild failed with code 65
    at SubProcess.<anonymous> (../../lib/webdriveragent.js:355:25)
    at emitTwo (events.js:106:13)

xcode 单独编译 Webdriveragent 就报这个错误
2016-12-29 11:49:30.951467 XCTRunner[987:290341] Running tests...
2016-12-29 11:49:31.055474 XCTRunner[987:290341] The bundle “WebDriverAgentRunner” couldn’t be loaded because it is damaged or missing necessary resources. Try reinstalling the bundle.
2016-12-29 11:49:31.055804 XCTRunner[987:290341] (dlopen_preflight(/var/containers/Bundle/Application/E0111AAF-DDA4-4AB4-888B-78792ED41D5B/WebDriverAgentRunner-Runner.app/PlugIns/WebDriverAgentRunner.xctest/WebDriverAgentRunner): Library not loaded: @rpath/Peertalk.framework/Peertalk
Referenced from: /private/var/containers/Bundle/Application/E0111AAF-DDA4-4AB4-888B-78792ED41D5B/WebDriverAgentRunner-Runner.app/PlugIns/WebDriverAgentRunner.xctest/Frameworks/WebDriverAgentLib.framework/WebDriverAgentLib
Reason: no suitable image found. Did find:
/private/var/containers/Bundle/Application/E0111AAF-DDA4-4AB4-888B-78792ED41D5B/WebDriverAgentRunner-Runner.app/PlugIns/WebDriverAgentRunner.xctest/Frameworks/WebDriverAgentLib.framework/Frameworks/Peertalk.framework/Peertalk: required code signature missing for '/private/var/containers/Bundle/Application/E0111AAF-DDA4-4AB4-888B-78792ED41D5B/WebDriverAgentRunner-Runner.app/PlugIns/WebDriverAgentRunner.xctest/Frameworks/WebDriverAgentLib.framework/Frameworks/Peertalk.framework/Peertalk'
)

@iriszhang @Lihuazhang 搞定了没有 team 不过又回到了
[debug] [XCUITest] Waiting for WebDriverAgent server to finish loading... 这个问题上 https://testerhome.com/topics/6774

匿名 #1 · 2016年12月30日

我在真机上 build WDA 就会报这个错,在模拟器是 OK 的,这是为什么,有没有遇到的小伙伴?

真机:iPhone5s 10.2

dyld: Library not loaded: @rpath/XCTest.framework/XCTest
  Referenced from: /var/containers/Bundle/Application/452BECD1-4D37-422A-816B-5BFAB986C210/WebDriverAgentRunner-Runner.app/XCTRunner
  Reason: no suitable image found.  Did find:
    /private/var/containers/Bundle/Application/452BECD1-4D37-422A-816B-5BFAB986C210/WebDriverAgentRunner-Runner.app/Frameworks/XCTest.framework/XCTest: code signing blocked mmap() of '/private/var/containers/Bundle/Application/452BECD1-4D37-422A-816B-5BFAB986C210/WebDriverAgentRunner-Runner.app/Frameworks/XCTest.framework/XCTest'
    /private/var/containers/Bundle/Application/452BECD1-4D37-422A-816B-5BFAB986C210/WebDriverAgentRunner-Runner.app/Frameworks/XCTest.framework/XCTest: code signing blocked mmap() of '/private/var/containers/Bundle/Application/452BECD1-4D37-422A-816B-5BFAB986C210/WebDriverAgentRunner-Runner.app/Frameworks/XCTest.framework/XCTest'
(lldb) 

#9 楼 @y693055797 看下 appium 1.6.3,你的 xcuitest-driver 是不是 2.5.1 的版本,我发现这个版本解决了你说的这个问题了

#11 楼 @iriszhang 这个要怎么升级呢 直接用 npm 下载的 appium 没有对这个进行操作过 但是不知道怎么升级 直接 npm unisntall xcuitest-driver 的话 appium 也没有了。。。

#12 楼 @y693055797 npm uninstall -g appium && npm install -g appium --no-shrinkwrap

手动执行 idevicedate -u 5fec064b64dbab3b3f988abb65726b52ac03b7d2
报下面这个错,怎么破?
ERROR: Could not connect to lockdownd, error code -5

匿名 #15 · 2017年02月19日

#14 楼 @app_test sudo chmod 777 /var/db/lockdownd/

请问是怎么解决 [XCUITest] xcodebuild exited with code '65' and signal 'null' 问题的呢?我把 libimobiledevice ideviceinstaller 删了重装也不行。

@y693055797 Command 'idevicedate -u XXXXXXX' exited with code 255 这个问题是怎么解决的呢,,在 1.6.4.beat 上没有这个问题,运行啥的都是正常的

需要 登录 后方可回复, 如果你还没有账号请点击这里 注册