错误:命令'java -version'用代码20退出

By simon at 2018-02-28 • 0人收藏 • 115人看过

1.我从Eclipse中运行android自动化测试

遇到内部错误运行命令:错误:命令'java -version'

用代码20退出

Appium Logfile: 

`[BaseDriver] Event 'newSessionRequested' logged at 1519716463353
(12:57:43 GMT+0530 (IST)) [Appium] Merged W3C capabilities
{"desiredCapabilities":{"app":"/Users/sathish/S... into
desiredCapabilities object
{"app":"/Users/sathish/Sathish/CASA/Automation ... [Appium] Creating
new AndroidDriver (v1.39.0) session [Appium] Capabilities: [Appium] 
app: /Users/sathish/Sathish/CASA/Automation
Test/EndlessAisleAutomationTest/app/app-qa-debug.apk [Appium]  
appActivity: tech.ajira.endlessAisle.activities.TenantLoginActivity
[Appium]   appPackage: tech.ajira.endlessAisle [Appium]  
deviceName: Google Nexus 9 [Appium]   platformName: android
[BaseDriver]  [BaseDriver] W3C capabilities [] and MJSONWP desired
capabilities  were provided [BaseDriver] Expected W3C "capabilities"
to be a JSON Object but was provided with: [] [BaseDriver] Falling
back to MJSONWP desired capabilities [BaseDriver] Session created
with session id: e1e27d58-611a-4877-b8fc-8e7e98351be1
[AndroidDriver] Getting Java version [AndroidDriver] Shutting down
Android driver [AndroidDriver] Called deleteSession but bootstrap
wasn't active [MJSONWP] Encountered internal error running command:
Error: Command 'java -version' exited with code 20
    at ChildProcess. (/Applications/Appium.app/Contents/Resources/app/node_modules/teen_process/lib/teen_process.js:97:19)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:194:7)
    at maybeClose (internal/child_process.js:899:16)
    at Socket. (internal/child_process.js:342:11)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:191:7)
    at Pipe._handle.close [as _onclose] (net.js:510:12) [HTTP] <-- POST /wd/hub/session 500 41 ms - 180`
     Please help me to fix this issue. Thank you

1 个回复 | 最后更新于 2018-02-28
2018-02-28   #1

似乎Appium无法连接到正在运行的模拟器。尝试设置 正确的值为deviceName和platformVersion capabi可以找到的 连接设备。 在命令提示符下,尝试运行adb devices以获取设备名称。

登录后方可回帖

Loading...