Appium appium:报错:[MJSONWP] Encountered internal error running command: Error: Could not find app apk at /Users/liubin/AndroidStudioProjects/src/main/java/apps/ContactManager.apk

哈哈哈 · February 24, 2018 · Last by 大海 replied at February 24, 2018 · 1672 hits

appiumLog
###
[Appium] Welcome to Appium v1.5.3

[Appium] Non-default server args:
[Appium] address: '127.0.0.1'
[Appium] debugLogSpacing: true

[Appium] platformName: 'Android'
[Appium] platformVersion: '8.1.0'
[Appium] automationName: 'Appium'
[Appium] app: '/Users/liubin/AndroidStudioProjects/DemoTest/src/main/java/apps/ContactManager.apk'
[Appium] Deprecated server args:
[Appium] --platform-name => --default-capabilities '{"platformName":"Android"}'

[Appium] --platform-version => --default-capabilities '{"platformVersion":"8.1.0"}'
[Appium] --automation-name => --default-capabilities '{"automationName":"Appium"}'
[Appium] --app => --default-capabilities '{"app":"/Users/liubin/AndroidStudioProjects/DemoTest/src/main/java/apps/ContactManager.apk"}'

[Appium] Default capabilities, which will be added to each request unless overridden by desired capabilities:

[Appium] platformName: 'Android'

[Appium] platformVersion: '8.1.0'

[Appium] automationName: 'Appium'

[Appium] app: '/Users/liubin/AndroidStudioProjects/DemoTest/src/main/java/apps/ContactManager.apk'

[Appium] Appium REST http interface listener started on 127.0.0.1:4723

[HTTP] --> GET /wd/hub/status {}

[MJSONWP] Calling AppiumDriver.getStatus() with args: []

[MJSONWP] Responding to client with driver.getStatus() result: {"build":{"version":"1.5.3"...

[HTTP] <-- GET /wd/hub/status 200 73 ms - 83

[HTTP] --> POST /wd/hub/session {"capabilities":{"desiredCapabilities":{"app":"/Users/liubin/AndroidStudioProjects/src/main/java/apps/ContactManager.apk","appPackage":"com.example.android.contactmanager","appActivity":".ContactManager","platformName":"Android","deviceName":"emulator-5554","platformVersion":"8.1.0"},"requiredCapabilities":{}},"desiredCapabilities":{"app":"/Users/liubin/AndroidStudioProjects/src/main/java/apps/ContactManager.apk","appPackage":"com.example.android.contactmanager","appActivity":".ContactManager","platformName":"Android","deviceName":"emulator-5554","platformVersion":"8.1.0"},"requiredCapabilities":{}}

[debug] [MJSONWP] Bad parameters: BadParametersError: Parameters were incorrect. We wanted {"required":["desiredCapabilities"],"optional":["requiredCapabilities","sessionId","id"]} and you sent ["capabilities","desiredCapabilities","requiredCapabilities"]

[HTTP] <-- POST /wd/hub/session 400 6 ms - 201

[HTTP] --> POST /wd/hub/session {"desiredCapabilities":{"app":"/Users/liubin/AndroidStudioProjects/src/main/java/apps/ContactManager.apk","appPackage":"com.example.android.contactmanager","appActivity":".ContactManager","platformName":"Android","deviceName":"emulator-5554","platformVersion":"8.1.0"},"requiredCapabilities":{}}

[MJSONWP] Calling AppiumDriver.createSession() with args: [{"app":"/Users/liubin/Andr...

[Appium] Creating new AndroidDriver session
[Appium] Capabilities:
[Appium] app: '/Users/liubin/AndroidStudioProjects/src/main/java/apps/ContactManager.apk'
[Appium] appPackage: 'com.example.android.contactmanager'
[Appium] appActivity: '.ContactManager'
[Appium] platformName: 'Android'
[Appium] deviceName: 'emulator-5554'
[Appium] platformVersion: '8.1.0'
[Appium] automationName: 'Appium'

[BaseDriver] Session created with session id: 7c54e0ea-761c-48a3-bbac-cc1ba5c9c525

[debug] [AndroidDriver] Getting Java version

[AndroidDriver] Java version is: 1.8.0_162

[ADB] Checking whether adb is present

[ADB] Using adb from /Users/liubin/Library/Android/sdk/platform-tools/adb

[AndroidDriver] Retrieving device list
[debug] [ADB] Trying to find a connected android device

[debug] [ADB] Getting connected devices...

[debug] [ADB] 1 device(s) connected

[AndroidDriver] Looking for a device with Android 8.1.0

[debug] [ADB] Setting device id to emulator-5554
[ADB] Getting device platform version
[debug] [ADB] Getting connected devices...

[debug] [ADB] 1 device(s) connected

[debug] [ADB] Running /Users/liubin/Library/Android/sdk/platform-tools/adb with args: ["-P",5037,"-s","emulator-5554","shell","getprop","ro.build.version.release"]

[AndroidDriver] Using device: emulator-5554

[ADB] Checking whether adb is present

[ADB] Using adb from /Users/liubin/Library/Android/sdk/platform-tools/adb
[debug] [ADB] Setting device id to emulator-5554
[BaseDriver] Using local app '/Users/liubin/AndroidStudioProjects/src/main/java/apps/ContactManager.apk'
[debug] [AndroidDriver] Checking whether app is actually present

[AndroidDriver] Error: Could not find app apk at /Users/liubin/AndroidStudioProjects/src/main/java/apps/ContactManager.apk
at Object.wrappedLogger.errorAndThrow (lib/logger.js:60:13)
at AndroidDriver.checkAppPresent$ (lib/driver.js:274:11)
at tryCatch (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
at GeneratorFunctionPrototype.invoke as _invoke
at GeneratorFunctionPrototype.prototype.(anonymous function) as next
at GeneratorFunctionPrototype.invoke (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
at run (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/babel-runtime/node_modules/core-js/library/modules/es6.promise.js:104:47)
at /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/babel-runtime/node_modules/core-js/library/modules/es6.promise.js:115:28
at flush (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/babel-runtime/node_modules/core-js/library/modules/$.microtask.js:19:5)
at _combinedTickCallback (internal/process/next_tick.js:67:7)
at process._tickCallback (internal/process/next_tick.js:98:9)
[Error: Could not find app apk at /Users/liubin/AndroidStudioProjects/src/main/java/apps/ContactManager.apk]

[debug] [AndroidDriver] Shutting down Android driver

[MJSONWP] Encountered internal error running command: Error: Could not find app apk at /Users/liubin/AndroidStudioProjects/src/main/java/apps/ContactManager.apk
at Object.wrappedLogger.errorAndThrow (lib/logger.js:60:13)
at AndroidDriver.checkAppPresent$ (lib/driver.js:274:11)
at tryCatch (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
at GeneratorFunctionPrototype.invoke as _invoke
at GeneratorFunctionPrototype.prototype.(anonymous function) as next
at GeneratorFunctionPrototype.invoke (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
at run (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/babel-runtime/node_modules/core-js/library/modules/es6.promise.js:104:47)
at /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/babel-runtime/node_modules/core-js/library/modules/es6.promise.js:115:28
at flush (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/babel-runtime/node_modules/core-js/library/modules/$.microtask.js:19:5)
at _combinedTickCallback (internal/process/next_tick.js:67:7)
at process._tickCallback (internal/process/next_tick.js:98:9)

[AndroidDriver] Cannot shut down Android driver; it has already shut down
[HTTP] <-- POST /wd/hub/session 500 952 ms - 236
[HTTP] --> POST /wd/hub/session {"capabilities":{"desiredCapabilities":{"app":"/Users/liubin/AndroidStudioProjects/src/main/java/apps/ContactManager.apk","appPackage":"com.example.android.contactmanager","appActivity":".ContactManager","platformName":"Android","deviceName":"emulator-5554","platformVersion":"8.1.0"},"requiredCapabilities":{}}}

[debug] [MJSONWP] Bad parameters: BadParametersError: Parameters were incorrect. We wanted {"required":["desiredCapabilities"],"optional":["requiredCapabilities","sessionId","id","sessionId","id","sessionId","id"]} and you sent ["capabilities"]
[HTTP] <-- POST /wd/hub/session 400 7 ms - 190

[HTTP] --> GET /wd/hub/status {}

[MJSONWP] Calling AppiumDriver.getStatus() with args: []

[MJSONWP] Responding to client with driver.getStatus() result: {"build":{"version":"1.5.3"...
[HTTP] <-- GET /wd/hub/status 200 24 ms - 83

[HTTP] --> GET /wd/hub/status {}

[MJSONWP] Calling AppiumDriver.getStatus() with args: []

[MJSONWP] Responding to client with driver.getStatus() result: {"build":{"version":"1.5.3"...

[HTTP] <-- GET /wd/hub/status 200 91 ms - 83

[HTTP] --> GET /wd/hub/status {}

[MJSONWP] Calling AppiumDriver.getStatus() with args: []

[MJSONWP] Responding to client with driver.getStatus() result: {"build":{"version":"1.5.3"...

[HTTP] <-- GET /wd/hub/status 200 107 ms - 83

[HTTP] --> GET /wd/hub/status {}

[MJSONWP] Calling AppiumDriver.getStatus() with args: []

[MJSONWP] Responding to client with driver.getStatus() result: {"build":{"version":"1.5.3"...

[HTTP] <-- GET /wd/hub/status 200 168 ms - 83

[HTTP] --> GET /wd/hub/status {}

[MJSONWP] Calling AppiumDriver.getStatus() with args: []

[MJSONWP] Responding to client with driver.getStatus() result: {"build":{"version":"1.5.3"...

[HTTP] <-- GET /wd/hub/status 200 164 ms - 83

[HTTP] --> GET /wd/hub/status {}

[MJSONWP] Calling AppiumDriver.getStatus() with args: []

[MJSONWP] Responding to client with driver.getStatus() result: {"build":{"version":"1.5.3"...

[HTTP] <-- GET /wd/hub/status 200 80 ms - 83

[HTTP] --> GET /wd/hub/status {}

[MJSONWP] Calling AppiumDriver.getStatus() with args: []

[MJSONWP] Responding to client with driver.getStatus() result: {"build":{"version":"1.5.3"...

[HTTP] <-- GET /wd/hub/status 200 71 ms - 83

[HTTP] --> GET /wd/hub/status {}

[MJSONWP] Calling AppiumDriver.getStatus() with args: []

[MJSONWP] Responding to client with driver.getStatus() result: {"build":{"version":"1.5.3"...

[HTTP] <-- GET /wd/hub/status 200 89 ms - 83

####

共收到 2 条回复 时间 点赞

第一次发帖,使用了语法,怎么没有显示... 大佬将就看,小白求帮助!!!

路径下的 apk 找不到,对着错误看下路径是否有问题

需要 Sign In 后方可回复, 如果你还没有账号请点击这里 Sign Up