Appium UiAutomator quit before it successfully launched 求解?

ben · 2014年04月17日 · 最后由 victors 回复于 2016年08月12日 · 3398 次阅读

Appium v1.0.0-beta.1 版本,运行 bootstrap 后开始报错。windows 系统


info: Running bootstrap
debug: spawning: D:\Program Files\Work\androideclipse\sdk\platform-tools\adb.exe -s 75860022
9FFC00000A3B9DEA05006025 shell uiautomator runtest AppiumBootstrap.jar -c io.appium.android.
bootstrap.Bootstrap
info: [UIAUTOMATOR STDOUT] INSTRUMENTATION_RESULT: shortMsg=java.lang.RuntimeException
info: [UIAUTOMATOR STDOUT] INSTRUMENTATION_RESULT: longMsg=Didn't find class "io.appium.andr
oid.bootstrap.Bootstrap" on path: /system/framework/android.test.runner.jar:/system/framewor
k/uiautomator.jar::/data/local/tmp/AppiumBootstrap.jar
info: [UIAUTOMATOR STDOUT] INSTRUMENTATION_CODE: 0
info: UiAutomator exited
debug: executing: "D:\Program Files\Work\androideclipse\sdk\platform-tools\adb.exe" -s 75860
0229FFC00000A3B9DEA05006025 shell "echo 'ping'"
info: Attempting to uninstall app
debug: Not uninstalling app since server not started with --full-reset
info: Cleaning up android objects
error: UiAutomator quit before it successfully launched
info: Cleaning up appium session
error: Failed to start an Appium session, err was: Error: UiAutomator quit before it success
fully launched
info: Error: UiAutomator quit before it successfully launched
    at null.<anonymous> (C:\Users\Administrator\AppData\Roaming\npm\node_modules\appium\lib\
devices\android\android.js:186:23)
    at androidHybrid.cleanupChromedriver (C:\Users\Administrator\AppData\Roaming\npm\node_mo
dules\appium\lib\devices\android\android-hybrid.js:79:5)
    at null.<anonymous> (C:\Users\Administrator\AppData\Roaming\npm\node_modules\appium\lib\
devices\android\android.js:181:10)
    at null.<anonymous> (C:\Users\Administrator\AppData\Roaming\npm\node_modules\appium\lib\
devices\android\android.js:203:9)
    at androidCommon.uninstallApp (C:\Users\Administrator\AppData\Roaming\npm\node_modules\a
ppium\lib\devices\android\android-common.js:400:5)
    at null.<anonymous> (C:\Users\Administrator\AppData\Roaming\npm\node_modules\appium\lib\
devices\android\android.js:201:12)
    at null.<anonymous> (C:\Users\Administrator\AppData\Roaming\npm\node_modules\appium\lib\
devices\android\android.js:210:11)
    at C:\Users\Administrator\AppData\Roaming\npm\node_modules\appium\lib\devices\android\ad
b.js:883:7
    at C:\Users\Administrator\AppData\Roaming\npm\node_modules\appium\lib\devices\android\ad
b.js:155:5
    at ChildProcess.exithandler (child_process.js:635:7)
info: Responding to client with error: {"status":33,"value":{"message":"A new session could
not be created. (Original error: UiAutomator quit before it successfully launched)","origVal
ue":"UiAutomator quit before it successfully launched"},"sessionId":null}
POST /wd/hub/session 500 8923ms - 246b

共收到 12 条回复 时间 点赞
ben #1 · 2014年04月17日 Author

@lihuazhang 求帮助。

#1 楼 @benlooking beta1 有问题很正常吧。。。 等正式版呗,没必要在这种 beta 版本上花时间。 而且这个日志我也分析不出来。。

#1 楼 @benlooking 你是更新到了 beta1 ,然后启动 server 就出错了? 没跑测试用例?

ben #4 · 2014年04月17日 Author

#3 楼 @lihuazhang 启动 server 没有出错,刚开始跑用例就出错了。但是同样的例子在 0.18 版本是 ok 的。。

试试删除机器上之前安装的 bootstrap.jar, 貌似是 jar 的版本不对

ben #6 · 2014年04月17日 Author

#5 楼@seveniruby所说,确实是 jar 版本的问题。
解决办法:删掉 AppiumBootstrap.jar

255|root@android:/data/local/tmp # ls
ls
AppiumBootstrap.jar
box
dalvik-cache
dd0d5eee21f038ba307089120db2bce9.apk
strings.json
uidump.xml
root@android:/data/local/tmp # rm AppiumBootstrap.jar
rm AppiumBootstrap.jar
root@android:/data/local/tmp # ls
ls
box
dalvik-cache
dd0d5eee21f038ba307089120db2bce9.apk
strings.json
uidump.xml

#6 楼 @benlooking 恩, 错误信息 log 里面也暗示了, 我也是猜测的

怎么删掉机器上之前安装的 bootstrap.jar

@benlooking@seveniruby,我也遇到这个问题,但删除 AppiumBootstrap.jar 后跑测试用例又报错了:

info: [debug] Error: Could not find AppiumBootstrap.jar; please run 'grunt buildAndroidBootstrap'
at null. (D:\software\python\Appium\node_modules\appium\lib\devices\android\android.js:358:10)
at Object.oncomplete (fs.js:107:15)
info: [debug] Responding to client with error: {"status":33,"value":{"message":"A new session could not be created. (Original error: Could not find AppiumBootstrap.jar; please run 'grunt buildAndroidBootstrap')","origValue":"Could not find AppiumBootstrap.jar; please run 'grunt buildAndroidBootstrap'"},"sessionId":null}

请教下怎么解决?谢谢

#9 楼 @cywin 这个问题解决了吗?
info: [debug] Responding to client with error: {"status":33,"value":{"message":"A new session could not be created. (Original error: Could not find AppiumBootstrap.jar; please run 'grunt buildAndroidBootstrap')","origValue":"Could not find AppiumBootstrap.jar; please run 'grunt buildAndroidBootstrap'"},"sessionId":null}

#10 楼 @huangrui127 惭愧,没解决。后来不知道换了一台手机跑又没错了。

#11 楼 @cywin 我也遇到了,我知道是什么问题,手机端的 uiautomator 端口被占用了,adb shell ps 杀一下进程就好,或者重启一下手机

victors [该话题已被删除] 中提及了此贴 08月12日 13:38
需要 登录 后方可回复, 如果你还没有账号请点击这里 注册