Cannot run script on Real Android Device with Appium 1.4.13 - Get Error com.android.browser is not installed on device
See original GitHub issueIssue: Cannot run script on Real Android Device with Appium 1.4.13 - Get Error com.android.browser is not installed on device
Environment: Mac El Capitan, Appium 1.4.13, Nexus 9 Android 5.1.1
Steps:
- npm install -g appium
- Open Appium GUI App 1.4.8 Select “Developer settings” and enable it. Select Use External NodeJS Binary to /usr/local/bin/node Select Use External Appium Package and link to appium folder path
- Enable USB debugging on Nexus 9 Tablet Android 5.1.1
- Connect Device and Run adb devices to get device name
- Set Android Settings: Check use Browser Chrome Set Platform Name - Android Set Platform Version - 5.1 Lollipop (AP1 Level 22) Set Device Name
- Start Appium Server
- Run script from Eclipse
Expected Results: To be able to run a script on a real Android device on appium to open a url on Chrome browser.
Actual Results: A new session could not be created. (Original error: An unknown server-side error occurred while processing the command. (Original error: unknown error: com.android.browser is not installed on device
Appium Logs: Launching Appium with command: ‘/usr/local/bin/node’ lib/server/main.js --command-timeout “7200” --debug-log-spacing --automation-name “Appium” --platform-name “Android” --platform-version “5.1” --app “browser” --browser-name “Chrome” --device-name “HT4CJJT00982” --device-ready-timeout “5”
info: Welcome to Appium v1.4.13 (REV c75d8adcb66a75818a542fe1891a34260c21f76a)
info: Appium REST http interface listener started on 0.0.0.0:4723
info: [debug] Non-default server args: {“app”:“browser”,“deviceName”:“HT4CJJT00982”,“platformName”:“Android”,“platformVersion”:“5.1”,“automationName”:“Appium”,“browserName”:“Chrome”,“defaultCommandTimeout”:7200,“debugLogSpacing”:true}
info: Console LogLevel: debug
info: --> GET /wd/hub/status {}
info: [debug] Responding to client with success: {“status”:0,“value”:{“build”:{“version”:“1.4.13”,“revision”:“c75d8adcb66a75818a542fe1891a34260c21f76a”}}}
info: <-- GET /wd/hub/status 200 13.814 ms - 105 {“status”:0,“value”:{“build”:{“version”:“1.4.13”,“revision”:“c75d8adcb66a75818a542fe1891a34260c21f76a”}}}
info: --> GET /wd/hub/status {}
info: [debug] Responding to client with success: {“status”:0,“value”:{“build”:{“version”:“1.4.13”,“revision”:“c75d8adcb66a75818a542fe1891a34260c21f76a”}}}
info: <-- GET /wd/hub/status 200 3.629 ms - 105 {“status”:0,“value”:{“build”:{“version”:“1.4.13”,“revision”:“c75d8adcb66a75818a542fe1891a34260c21f76a”}}}
info: --> GET /wd/hub/status {}
info: [debug] Responding to client with success: {“status”:0,“value”:{“build”:{“version”:“1.4.13”,“revision”:“c75d8adcb66a75818a542fe1891a34260c21f76a”}}} info: <-- GET /wd/hub/status 200 1.218 ms - 105 {“status”:0,“value”:{“build”:{“version”:“1.4.13”,“revision”:“c75d8adcb66a75818a542fe1891a34260c21f76a”}}}
info: --> GET /wd/hub/status {}
info: [debug] Responding to client with success: {“status”:0,“value”:{“build”:{“version”:“1.4.13”,“revision”:“c75d8adcb66a75818a542fe1891a34260c21f76a”}}} info: <-- GET /wd/hub/status 200 0.806 ms - 105 {“status”:0,“value”:{“build”:{“version”:“1.4.13”,“revision”:“c75d8adcb66a75818a542fe1891a34260c21f76a”}}}
info: --> POST /wd/hub/session {“desiredCapabilities”:{“browserName”:“Chrome”,“platformName”:“Android”,“deviceName”:“HT4CJJT00982”,“platformVersion”:“5.1.1”}}
info: Client User-Agent string: Apache-HttpClient/4.4.1 (Java/1.8.0_60) info: ************************************* info: ************************************* info: ************************************* info: ************************************* info: ************************************* info: ************************************* info: ************************************* info: *************************************
info: **** NEW SESSION *** info: **** NEW SESSION *** info: **** NEW SESSION *** info: **** NEW SESSION *** info: **** NEW SESSION *** info: **** NEW SESSION *** info: **** NEW SESSION *** info: **** NEW SESSION *** info: ************************************* info: ************************************* info: ************************************* info: ************************************* info: ************************************* info: ************************************* info: ************************************* info: ************************************* info: Set mode: Proxying straight through to Chromedriver info: [debug] Looks like we want chrome on android info: [debug] Creating new appium session 30afda1a-107d-4f7f-a1f6-40719ea2eb6f info: [debug] Checking whether adb is present info: [debug] Using adb from /Users/vnvdm/Documents/android-sdk-macosx/platform-tools/adb info: [debug] Using fast reset? true info: [debug] Preparing device for session info: [debug] Not checking whether app is present since we are assuming it’s already on the device info: Retrieving device info: [debug] Trying to find a connected android device info: [debug] Getting connected devices… info: [debug] executing cmd: /Users/vnvdm/Documents/android-sdk-macosx/platform-tools/adb devices
info: [debug] 1 device(s) connected
info: Found device HT4CJJT00982 info: [debug] Setting device id to HT4CJJT00982 info: [debug] Waiting for device to be ready and to respond to shell commands (timeout = 5)
info: [debug] executing cmd: /Users/vnvdm/Documents/android-sdk-macosx/platform-tools/adb -s HT4CJJT00982 wait-for-device
info: [debug] executing cmd: /Users/vnvdm/Documents/android-sdk-macosx/platform-tools/adb -s HT4CJJT00982 shell “echo ‘ready’”
info: [debug] Starting logcat capture
info: [debug] Pushing unlock helper app to device…
info: [debug] executing cmd: /Users/vnvdm/Documents/android-sdk-macosx/platform-tools/adb -s HT4CJJT00982 install “/usr/local/lib/node_modules/appium/build/unlock_apk/unlock_apk-debug.apk”
info: [debug] executing cmd: /Users/vnvdm/Documents/android-sdk-macosx/platform-tools/adb -s HT4CJJT00982 shell “dumpsys window”
info: [debug] Screen already unlocked, continuing.
info: [debug] Forwarding system:4724 to device:4724 info: [debug] executing cmd: /Users/vnvdm/Documents/android-sdk-macosx/platform-tools/adb -s HT4CJJT00982 forward tcp:4724 tcp:4724
info: [debug] Pushing appium bootstrap to device…
info: [debug] executing cmd: /Users/vnvdm/Documents/android-sdk-macosx/platform-tools/adb -s HT4CJJT00982 push “/usr/local/lib/node_modules/appium/build/android_bootstrap/AppiumBootstrap.jar” /data/local/tmp/
info: Starting App
info: [debug] Attempting to kill all ‘uiautomator’ processes info: [debug] Getting all processes with ‘uiautomator’ info: [debug] executing cmd: /Users/vnvdm/Documents/android-sdk-macosx/platform-tools/adb -s HT4CJJT00982 shell “ps ‘uiautomator’”
info: [debug] No matching processes found
info: [debug] Running bootstrap info: [debug] spawning: /Users/vnvdm/Documents/android-sdk-macosx/platform-tools/adb -s HT4CJJT00982 shell uiautomator runtest AppiumBootstrap.jar -c io.appium.android.bootstrap.Bootstrap -e pkg com.android.browser -e disableAndroidWatchers false
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: numtests=1
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: stream= info: [debug] [UIAUTOMATOR STDOUT] io.appium.android.bootstrap.Bootstrap: info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: id=UiAutomatorTestRunner info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: test=testRunServer info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: class=io.appium.android.bootstrap.Bootstrap info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: current=1 info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS_CODE: 1
info: [debug] [BOOTSTRAP] [debug] Socket opened on port 4724
info: [debug] [BOOTSTRAP] [debug] Appium Socket Server Ready info: [debug] [BOOTSTRAP] [debug] Loading json… info: [debug] Pushing command to appium work queue: [“getDataDir”,{}] info: [debug] [BOOTSTRAP] [debug] Registered crash watchers. info: [debug] [BOOTSTRAP] [debug] Client connected info: [debug] [BOOTSTRAP] [debug] Got data from client: {“cmd”:“action”,“action”:“getDataDir”,“params”:{}} info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION info: [debug] [BOOTSTRAP] [debug] Got command action: getDataDir info: [debug] dataDir set to: /data/local/tmp
info: Chromedriver: Changed state to ‘starting’ info: [debug] [BOOTSTRAP] [debug] Returning result: {“status”:0,“value”:“/data/local/tmp”} info: Chromedriver: Set chromedriver binary as: /usr/local/lib/node_modules/appium/node_modules/appium-chromedriver/chromedriver/mac/chromedriver info: Chromedriver: Killing any old chromedrivers, running: ps -ef | grep /usr/local/lib/node_modules/appium/node_modules/appium-chromedriver/chromedriver/mac/chromedriver | grep -v grep |grep -e ‘–port=9515(\s.*)?$’ | awk ‘{ print $2 }’ | xargs kill -15
info: Chromedriver: Successfully cleaned up old chromedrivers
info: Chromedriver: Spawning chromedriver with: /usr/local/lib/node_modules/appium/node_modules/appium-chromedriver/chromedriver/mac/chromedriver --url-base=wd/hub --port=9515
info: Chromedriver: [STDOUT] Starting ChromeDriver 2.19.346063 (38b35413bd4a486d436a9749e090454bc9ff6708) on port 9515 Only local connections are allowed.
info: JSONWP Proxy: Proxying [GET /status] to [GET http://127.0.0.1:9515/wd/hub/status] with no body
info: JSONWP Proxy: Proxying [GET /status] to [GET http://127.0.0.1:9515/wd/hub/status] with no body
info: JSONWP Proxy: Got response with status 200: {“sessionId”:“”,“status”:0,“value”:{“build”:{“version”:“alpha”},“os”:{“arch”:“x86_64”,“name”:“Mac OS X”,“version”:“10.11.0”}}}
info: JSONWP Proxy: Proxying [POST /session] to [POST http://127.0.0.1:9515/wd/hub/session] with body: {“desiredCapabilities”:{“chromeOptions”:{“androidPackage”:“com.android.browser”,“androidActivity”:“com.android.browser.BrowserActivity”,“androidDeviceSerial”:“HT4CJJT00982”}}}
info: JSONWP Proxy: Got response with status 200: {“sessionId”:“f8e6e1641ff7e327d1e7cfe05349a97f”,“status”:13,“value”:{“message”:"unknown error: Device HT4CJJT00982 is not online\n (Driver info: chromedriver=2.19.346063 (38b35413bd4a486d436a9749e090…
info: JSONWP Proxy: Proxying [POST /session] to [POST http://127.0.0.1:9515/wd/hub/session] with body: {“desiredCapabilities”:{“chromeOptions”:{“androidPackage”:“com.android.browser”,“androidActivity”:“com.android.browser.BrowserActivity”,“androidDeviceSerial”:“HT4CJJT00982”}}}
info: JSONWP Proxy: Got response with status 200: {“sessionId”:“8276b1ee12f724e08eff9415f86b580a”,“status”:13,“value”:{“message”:"unknown error: Device HT4CJJT00982 is not online\n (Driver info: chromedriver=2.19.346063 (38b35413bd4a486d436a9749e090…
info: JSONWP Proxy: Proxying [POST /session] to [POST http://127.0.0.1:9515/wd/hub/session] with body: {“desiredCapabilities”:{“chromeOptions”:{“androidPackage”:“com.android.browser”,“androidActivity”:“com.android.browser.BrowserActivity”,“androidDeviceSerial”:“HT4CJJT00982”}}}
info: JSONWP Proxy: Got response with status 200: {“sessionId”:“8455b6216dc4df3a0e2cf5417b175fd8”,“status”:13,“value”:{“message”:"unknown error: com.android.browser is not installed on device HT4CJJT00982\n (Driver info: chromedriver=2.19.346063 (38…
info: JSONWP Proxy: Proxying [POST /session] to [POST http://127.0.0.1:9515/wd/hub/session] with body: {“desiredCapabilities”:{“chromeOptions”:{“androidPackage”:“com.android.browser”,“androidActivity”:“com.android.browser.BrowserActivity”,“androidDeviceSerial”:“HT4CJJT00982”}}}
info: JSONWP Proxy: Got response with status 200: {“sessionId”:“ae75d47f76de129e042a232af52f3cfc”,“status”:13,“value”:{“message”:"unknown error: com.android.browser is not installed on device HT4CJJT00982\n (Driver info: chromedriver=2.19.346063 (38…
info: Chromedriver: Changed state to ‘stopped’
error: Chromedriver: Chromedriver exited unexpectedly with code null, signal SIGTERM
info: Chromedriver stopped unexpectedly on us, shutting down then calling back up with the on-die callback
error: Chromedriver: Error: An unknown server-side error occurred while processing the command. (Original error: unknown error: com.android.browser is not installed on device HT4CJJT00982 (Driver info: chromedriver=2.19.346063 (38b35413bd4a486d436a9749e090454bc9ff6708),platform=Mac OS X 10.11.0 x86_64)) at JWProxy.command$ (lib/proxy.js:149:15) at tryCatch (/usr/local/lib/node_modules/appium/node_modules/appium-chromedriver/node_modules/babel-runtime/regenerator/runtime.js:67:40) at GeneratorFunctionPrototype.invoke as _invoke at GeneratorFunctionPrototype.prototype.(anonymous function) as next at GeneratorFunctionPrototype.invoke (/usr/local/lib/node_modules/appium/node_modules/appium-chromedriver/node_modules/babel-runtime/regenerator/runtime.js:136:37) at bound (domain.js:254:14) at GeneratorFunctionPrototype.runBound (domain.js:267:12) at run (/usr/local/lib/node_modules/appium/node_modules/appium-chromedriver/node_modules/babel-runtime/node_modules/core-js/library/modules/es6.promise.js:89:39) at /usr/local/lib/node_modules/appium/node_modules/appium-chromedriver/node_modules/babel-runtime/node_modules/core-js/library/modules/es6.promise.js💯28 at process._tickDomainCallback (node.js:381:11) { [Error: An unknown server-side error occurred while processing the command. (Original error: unknown error: com.android.browser is not installed on device HT4CJJT00982 (Driver info: chromedriver=2.19.346063 (38b35413bd4a486d436a9749e090454bc9ff6708),platform=Mac OS X 10.11.0 x86_64))] status: 13, value: { message: ‘unknown error: com.android.browser is not installed on device HT4CJJT00982\n (Driver info: chromedriver=2.19.346063 (38b35413bd4a486d436a9749e090454bc9ff6708),platform=Mac OS X 10.11.0 x86_64)’ }, httpCode: 200 }
info: [debug] Cleaning up appium session
error: Failed to start an Appium session, err was: Error: An unknown server-side error occurred while processing the command. (Original error: unknown error: com.android.browser is not installed on device HT4CJJT00982 (Driver info: chromedriver=2.19.346063 (38b35413bd4a486d436a9749e090454bc9ff6708),platform=Mac OS X 10.11.0 x86_64))
info: [debug] Error: An unknown server-side error occurred while processing the command. (Original error: unknown error: com.android.browser is not installed on device HT4CJJT00982 (Driver info: chromedriver=2.19.346063 (38b35413bd4a486d436a9749e090454bc9ff6708),platform=Mac OS X 10.11.0 x86_64)) at JWProxy.command$ (lib/proxy.js:149:15) at tryCatch (/usr/local/lib/node_modules/appium/node_modules/appium-chromedriver/node_modules/babel-runtime/regenerator/runtime.js:67:40) at GeneratorFunctionPrototype.invoke as _invoke at GeneratorFunctionPrototype.prototype.(anonymous function) as next at GeneratorFunctionPrototype.invoke (/usr/local/lib/node_modules/appium/node_modules/appium-chromedriver/node_modules/babel-runtime/regenerator/runtime.js:136:37) at bound (domain.js:254:14) at GeneratorFunctionPrototype.runBound (domain.js:267:12) at run (/usr/local/lib/node_modules/appium/node_modules/appium-chromedriver/node_modules/babel-runtime/node_modules/core-js/library/modules/es6.promise.js:89:39) at /usr/local/lib/node_modules/appium/node_modules/appium-chromedriver/node_modules/babel-runtime/node_modules/core-js/library/modules/es6.promise.js💯28 at process._tickDomainCallback (node.js:381:11) info: [debug] Responding to client with error: {“status”:33,“value”:{“message”:“A new session could not be created. (Original error: An unknown server-side error occurred while processing the command. (Original error: unknown error: com.android.browser is not installed on device HT4CJJT00982\n (Driver info: chromedriver=2.19.346063 (38b35413bd4a486d436a9749e090454bc9ff6708),platform=Mac OS X 10.11.0 x86_64)))”,“status”:13,“value”:{“message”:“unknown error: com.android.browser is not installed on device HT4CJJT00982\n (Driver info: chromedriver=2.19.346063 (38b35413bd4a486d436a9749e090454bc9ff6708),platform=Mac OS X 10.11.0 x86_64)”},“httpCode”:200,“origValue”:“An unknown server-side error occurred while processing the command. (Original error: unknown error: com.android.browser is not installed on device HT4CJJT00982\n (Driver info: chromedriver=2.19.346063 (38b35413bd4a486d436a9749e090454bc9ff6708),platform=Mac OS X 10.11.0 x86_64))”},“sessionId”:null} info: <-- POST /wd/hub/session 500 5755.534 ms - 923 info: [debug] UiAutomator shut down normally info: [debug] executing cmd: /Users/vnvdm/Documents/android-sdk-macosx/platform-tools/adb -s HT4CJJT00982 shell “am force-stop com.android.browser” info: [debug] [BOOTSTRAP] [debug] Got data from client: {“cmd”:“shutdown”} info: [debug] [BOOTSTRAP] [debug] Got command of type SHUTDOWN info: [debug] [BOOTSTRAP] [debug] Returning result: {“status”:0,“value”:“OK, shutting down”} info: [debug] [BOOTSTRAP] [debug] Closed client connection info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: numtests=1 info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: stream=. info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: id=UiAutomatorTestRunner info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: test=testRunServer info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: class=io.appium.android.bootstrap.Bootstrap info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: current=1 info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS_CODE: 0 info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: stream= info: [debug] [UIAUTOMATOR STDOUT] Test results for WatcherResultPrinter=. info: [debug] [UIAUTOMATOR STDOUT] Time: 2.465 info: [de bug] [UIAUTOMATOR STDOUT] OK (1 test) info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS_CODE: -1
info: [debug] Stopping logcat capture
info: [debug] Logcat terminated with code null, signal SIGTERM info: [debug] Cleaning up appium session
Script:
package com.example.appium;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.By;
import org.openqa.selenium.Keys;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import io.appium.java_client.android.AndroidDriver;
import io.appium.java_client.remote.MobileCapabilityType;
public class AndroidRealDeviceWithAndroidDriver {
@SuppressWarnings("rawtypes")
AndroidDriver driver;
@SuppressWarnings("rawtypes")
@BeforeClass
public void setUp() throws MalformedURLException{
DesiredCapabilities caps = new DesiredCapabilities();
caps.setCapability(MobileCapabilityType.BROWSER_NAME,"Chrome");
caps.setCapability(MobileCapabilityType.PLATFORM_VERSION, "5.1.1");
caps.setCapability(MobileCapabilityType.PLATFORM_NAME, "Android");
caps.setCapability(MobileCapabilityType.DEVICE_NAME, "xyz");
driver = new AndroidDriver (new URL("http://127.0.0.1:4723/wd/hub"), caps);
driver.manage().timeouts().implicitlyWait(30,TimeUnit.SECONDS);
}
@Test
public void testExample() throws InterruptedException {
driver.get("https://www.google.com");
WebElement searchBox=driver.findElement(By.name("q"));
searchBox.sendKeys("Appium for mobile automation");
searchBox.sendKeys(Keys.RETURN);
Thread.sleep(50000);
}
@AfterClass
public void tearDown(){
driver.quit();
}
}
Issue Analytics
- State:
- Created 8 years ago
- Comments:9
Top GitHub Comments
dont set anything in Android settings , and set
--app="Chrome"
incustomer server flags
after enabling developer options in 4th screen.This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.