Appium appium 真机调试失败问题

kuroky · 2015年08月12日 · 最后由 Mr Wang 回复于 2016年04月22日 · 2913 次阅读

使用真机执行用例,抱如下错误:

info: [debug] Dynamic bootstrap code: // This file is automatically generated. Do not manually modify!
...

info: [debug] Dynamic bootstrap path: /Users/XXXXX/Library/Application Support/appium/bootstrap/bootstrap-6745615c424bb0c0.js

info: [debug] Reusing dynamic bootstrap: /Users/XXXXX/Library/Application Support/appium/bootstrap/bootstrap-6745615c424bb0c0.js

info: [debug] Attempting iOS device log capture via libimobiledevice idevicesyslog

info: [debug] Creating iDevice object with udid eeeeeeeeeeeeeeeeeeeee

info: [debug] App is not installed. Will try to install the app.

info: [debug] Cleaning up appium session

info: [debug] Error: Command failed: /bin/sh -c ideviceinstaller -u eeeeeeeeeeeeeeeeeeeee -i com.test

    at ChildProcess.exithandler (child_process.js:751:12)
    at ChildProcess.emit (events.js:110:17)
    at maybeClose (child_process.js:1015:16)
    at Process.ChildProcess._handle.onexit (child_process.js:1087:5)
info: [debug] Responding to client with error: {"status":33,"value":{"message":"A new session could not be created. (Original error: Command failed: /bin/sh -c ideviceinstaller -u eeeeeeeeeeeeeeeeeeeee -i com.test\n)","killed":false,"code":null,"signal":"SIGSEGV","cmd":"/bin/sh -c ideviceinstaller -u eeeeeeeeeeeeeeeeeeeee -i com.test","origValue":"Command failed: /bin/sh -c ideviceinstaller -u eeeeeeeeeeeeeeeeeeeee -i com.test\n"},"sessionId":null}

appium version: 1.4.8 dmg 安装
ios version :8.4.3
经查 是 ideviceinstaller 的 问题,然后重新安装,发现提示已经安装,但是使用 ideviceinstaller -l 时出错,请问大家有没有遇到过这个问题,如何解决

$ brew install -HEAD ideviceinstaller
Warning: ideviceinstaller-1.0.1 already installed
$ ideviceinstaller -l
Segmentation fault: 11
如果觉得我的文章对您有用,请随意打赏。您的支持将鼓励我继续创作!
共收到 13 条回复 时间 点赞

ideviceinstaller 都段错误了。 建议你重装:
brew install libimobiledevice

#1 楼 @lihuazhang
重新装了,命令如下,还是会出 Segmentation fault: 11

$ brew uninstall libimobiledevice
Uninstalling /usr/local/Cellar/libimobiledevice/1.1.6_1...
$ brew uninstall ideviceinstaller
Uninstalling /usr/local/Cellar/ideviceinstaller/1.0.1...
$ brew install ideviceinstaller
==> Installing ideviceinstaller dependency: libimobiledevice
==> Downloading http://www.libimobiledevice.org/downloads/libimobiledevice-1.1.6
Already downloaded: /Library/Caches/Homebrew/libimobiledevice-1.1.6.tar.bz2
==> ./configure --disable-silent-rules --prefix=/usr/local/Cellar/libimobiledevi
==> make install
🍺  /usr/local/Cellar/libimobiledevice/1.1.6_1: 58 files, 892K, built in 18 seconds
==> Installing ideviceinstaller
==> Downloading http://www.libimobiledevice.org/downloads/ideviceinstaller-1.0.1
Already downloaded: /Library/Caches/Homebrew/ideviceinstaller-1.0.1.tar.bz2
==> ./configure --prefix=/usr/local/Cellar/ideviceinstaller/1.0.1
==> make install
🍺  /usr/local/Cellar/ideviceinstaller/1.0.1: 7 files, 80K, built in 9 seconds


$ ideviceinstaller -l
Segmentation fault: 11

#2 楼 @kuroky

brew uninstall libimobiledevice
brew install --HEAD libimobiledevice

#3 楼 @lihuazhang
还是不行

brew uninstall libimobiledevice
Uninstalling /usr/local/Cellar/libimobiledevice/1.1.6_1...
$ brew install -HEAD  libimobiledevice
==> Downloading http://www.libimobiledevice.org/downloads/libimobiledevice-1.1.6
Already downloaded: /Library/Caches/Homebrew/libimobiledevice-1.1.6.tar.bz2
==> ./configure --disable-silent-rules --prefix=/usr/local/Cellar/libimobiledevi
==> make install
🍺  /usr/local/Cellar/libimobiledevice/1.1.6_1: 58 files, 892K, built in 21 seconds
$ ideviceinstaller -l
No iPhone found, is it plugged in?
//接了真机以后
$ ideviceinstaller -l
Segmentation fault: 11

试下装个最新的 homebrew ?
网上有人说 brew 版本太老也不行,不兼容新的 ideviceinstaller 自动安装脚本。

#5 楼 @chenhengjie123
全部卸载,然后

brew install --HEAD libimobiledevice
brew install --HEAD ideviceinstaller

#6 楼 @kuroky 然后解决了吗?
homebrew 本身要更新到最新版哦。

#7 楼 @chenhengjie123 解决了 thx,但是还有个小问题,以前我在模拟器上写出来的用例在真机上貌似有问题,真迹取出来的 xpath,貌似和模拟器的不一样

#8 楼 @kuroky 具体哪里不一样?

kuroky #10 · 2015年08月14日 Author

#9 楼 @chenhengjie123 有些地方在模拟上有 text 值,但是真机上没有,有些地方 app 文件通过 inspector 抓出来的 xpath 比 ipa 文件会多一层

#10 楼 @kuroky 建议你先在同一个界面使用 driver.source 获取界面元素树,然后再去 diff 出区别吧?
你这么说比较模糊,而且 inspector 显示出来的属性有些是和真正的 xml 文件有出入的(特别是 visible 属性),不能全信。

#8 楼 @kuroky 请问你是怎么解决这个问题的?我用真机可以,但是用模拟器还是提示 err was: Error: Command failed: /bin/sh -c ideviceinstaller

#8 楼 @kuroky 请问你如何解决的 我也遇到了同样的问题

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