Appium(On Mac) cannot launch chrome on android real device

Hi all,

I have a Samsung Android phone(Android6.0.1), and want run our case on Android real device, so I connect the phone to Mac, and start to run our case, and get the errors for AndroidDriver is shutdown…

I tried adb devices, and can get the device list,
Also tried to start the chrome by adb command:
> adb shell am start -n com.android.chrome/com.google.android.apps.chrome.Main
the chrome started correctly.

Here’s appium log:

[Appium] Welcome to Appium v1.5.3

[Appium] Non-default server args:

[Appium] sessionOverride: true
[Appium] log: ‘/tmp/appium.log’
[Appium] debugLogSpacing: true
[Appium] platformName: ‘Android’
[Appium] platformVersion: ‘6.0.1’
[Appium] automationName: ‘Appium’
[Appium] fullReset: true
[Appium] appPackage: ‘com.android.chrome’
[Appium] appActivity: ‘com.google.android.apps.chrome.Main’
[Appium] dontStopAppOnReset: true
[Appium] Deprecated server args:
[Appium] --platform-name => --default-capabilities ‘{“platformName”:“Android”}’
[Appium] --platform-version => --default-capabilities ‘{“platformVersion”:“6.0.1”}’
[Appium] --automation-name => --default-capabilities ‘{“automationName”:“Appium”}’
[Appium] --full-reset => --default-capabilities ‘{“fullReset”:true}’
[Appium] --app-pkg => --default-capabilities ‘{“appPackage”:“com.android.chrome”}’
[Appium] --app-activity => --default-capabilities ‘{“appActivity”:“com.google.android.apps.chrome.Main”}’
[Appium] --dont-stop-app-on-reset => --default-capabilities ‘{“dontStopAppOnReset”:true}’
[Appium] Default capabilities, which will be added to each request unless overridden by desired capabilities:
[Appium] platformName: ‘Android’
[Appium] platformVersion: ‘6.0.1’
[Appium] automationName: ‘Appium’
[Appium] fullReset: true
[Appium] appPackage: ‘com.android.chrome’
[Appium] appActivity: ‘com.google.android.apps.chrome.Main’
[Appium] dontStopAppOnReset: true

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

[HTTP] → POST /wd/hub/session {“desiredCapabilities”:{“app”:“chrome”,“platformName”:“Android”,“deviceName”:“67fdb254”,“version”:“6.0”}}

[MJSONWP] Calling AppiumDriver.createSession() with args: [{“app”:“chrome”,"platformN…

[Appium] Creating new AndroidDriver session
[Appium] Capabilities:
[Appium] app: ‘chrome’
[Appium] platformName: ‘Android’
[Appium] deviceName: ‘67fdb254’
[Appium] version: ‘6.0’
[Appium] platformVersion: ‘6.0.1’
[Appium] automationName: ‘Appium’
[Appium] fullReset: true
[Appium] appPackage: ‘com.android.chrome’
[Appium] appActivity: ‘com.google.android.apps.chrome.Main’
[Appium] dontStopAppOnReset: true
[BaseDriver] The following capabilities were provided, but are not recognized by appium: version.
[BaseDriver] Session created with session id: 00332ea2-09e7-46b5-bf90-fa40a53e32c6
[debug] [AndroidDriver] Getting Java version

[AndroidDriver] Java version is: 1.8.0_65
[ADB] Checking whether adb is present
[ADB] Using adb from /usr/local/Cellar/android-sdk/24.4.1/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 6.0.1
[debug] [ADB] Setting device id to 67fdb254
[ADB] Getting device platform version
[debug] [ADB] Getting connected devices…
[debug] [ADB] 1 device(s) connected

[debug] [ADB] Running /usr/local/Cellar/android-sdk/24.4.1/platform-tools/adb with args: [“-P”,5037,“-s”,“67fdb254”,“shell”,“getprop”,“ro.build.version.release”]
[AndroidDriver] Using device: 67fdb254
[ADB] Checking whether adb is present
[ADB] Using adb from /usr/local/Cellar/android-sdk/24.4.1/platform-tools/adb
[debug] [ADB] Setting device id to 67fdb254
[BaseDriver] Using local app ‘chrome’
[debug] [AndroidDriver] Shutting down Android driver
[AndroidDriver] Cannot shut down Android driver; it has already shut down

[MJSONWP] Encountered internal error running command: Error: New app path chrome did not have extension .apk
at Object.configureApp$ (lib/basedriver/helpers.js:41:11)
at tryCatch (/Applications/Appium 2.app/Contents/Resources/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
at GeneratorFunctionPrototype.invoke [as _invoke] (/Applications/Appium 2.app/Contents/Resources/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)
at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/Applications/Appium 2.app/Contents/Resources/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
at invoke (/Applications/Appium 2.app/Contents/Resources/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
at enqueueResult (/Applications/Appium 2.app/Contents/Resources/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:185:17)
at new Promise (/Applications/Appium 2.app/Contents/Resources/node_modules/appium/node_modules/babel-runtime/node_modules/core-js/library/modules/es6.promise.js:197:7)
at AsyncIterator.enqueue (/Applications/Appium 2.app/Contents/Resources/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:184:12)
at AsyncIterator.prototype.(anonymous function) [as next] (/Applications/Appium 2.app/Contents/Resources/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
at Object.runtime.async (/Applications/Appium 2.app/Contents/Resources/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:209:12)
at Object.configureApp (lib/basedriver/helpers.js:22:21)
at AndroidDriver.createSession$ (lib/driver.js:127:44)
at tryCatch (/Applications/Appium 2.app/Contents/Resources/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
at GeneratorFunctionPrototype.invoke [as _invoke] (/Applications/Appium 2.app/Contents/Resources/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)
at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/Applications/Appium 2.app/Contents/Resources/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
at GeneratorFunctionPrototype.invoke (/Applications/Appium 2.app/Contents/Resources/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
at run (/Applications/Appium 2.app/Contents/Resources/node_modules/appium/node_modules/babel-runtime/node_modules/core-js/library/modules/es6.promise.js:104:47)
at /Applications/Appium 2.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 2.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)

[HTTP] ← POST /wd/hub/session 500 406 ms - 184

Here’s config for android setting:



I had same problem ,just resolved yesterday by updating chrome app in my device,so update chrome till very recent version i think its around 53*

I updated my chrome app in device, but still not work…:joy:

Problem solved!!! haha
found out and tried a lot with the error

"[MJSONWP] Encountered internal error running command: Error: New app path chrome did not have extension .apk "
If run a test case on a remote webderiver , need to set capability in the code first, and Appium will install chrome apk ,and it happened just once when you start to run your case for the first time (If you’re not reset the device…)

If just use the check inspector option, need to set the apk in appium like following