Chrome Browser Opens and Close without hitting the URL

Hi Team,

When am trying to launch Chrome Browser in Android device from my mac machine, then the browser just opens and closes. It doesn’t hit the url. Please help on this regard.

Appium Logs:
Launching Appium with command: export ANDROID_HOME="/Users/Manoj/Library/Android/sdk"; ‘/Applications/Appium.app/Contents/Resources/node/bin/node’ appium/build/lib/main.js --address “127.0.0.1” --debug-log-spacing --automation-name “Appium” --platform-name “Android” --platform-version “5.0.1” --app “” --device-name “4d0043fcb6a1a0ad”

[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: ‘5.0.1’
[Appium] automationName: ‘Appium’
[Appium] deviceName: ‘4d0043fcb6a1a0ad’
[Appium] app: ‘’

[Appium] Deprecated server args:

[Appium] --platform-name => --default-capabilities ‘{“platformName”:“Android”}’
[Appium] --platform-version => --default-capabilities ‘{“platformVersion”:“5.0.1”}’

[Appium] --automation-name => --default-capabilities ‘{“automationName”:“Appium”}’
[Appium] --device-name => --default-capabilities ‘{“deviceName”:“4d0043fcb6a1a0ad”}’
[Appium] --app => --default-capabilities ‘{“app”:""}’
[Appium] Default capabilities, which will be added to each request unless overridden by desired capabilities:

[Appium] platformName: ‘Android’

[Appium] platformVersion: ‘5.0.1’
[Appium] automationName: ‘Appium’
[Appium] deviceName: ‘4d0043fcb6a1a0ad’
[Appium] app: ‘’

[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 118 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 22 ms - 83

[HTTP] --> POST /wd/hub/session {“desiredCapabilities”:{“browserName”:“Chrome”,“platformName”:“Android”,“deviceName”:“4d0043fcb6a1a0ad”,“newCommandTimeout”:“600”}}

[MJSONWP] Calling AppiumDriver.createSession() with args: [{“browserName”:“Chrome”,"p…

[Appium] Creating new AndroidDriver session
[Appium] Capabilities:
[Appium] browserName: ‘Chrome’
[Appium] platformName: ‘Android’
[Appium] deviceName: ‘4d0043fcb6a1a0ad’
[Appium] newCommandTimeout: ‘600’
[Appium] platformVersion: ‘5.0.1’
[Appium] automationName: ‘Appium’
[Appium] app: ‘’

[BaseDriver] Capability ‘newCommandTimeout’ changed from string (‘600’) to integer (600). This may cause unexpected behavior

[BaseDriver] Session created with session id: 38dc7c23-c737-4b34-987a-f13eb29e1fad

[debug] [AndroidDriver] Getting Java version

[AndroidDriver] Java version is: 1.8.0_66

[AndroidDriver] We’re going to run a Chrome-based session
[AndroidDriver] Chrome-type package and activity are com.android.chrome and com.google.android.apps.chrome.Main

[ADB] Checking whether adb is present

[ADB] Using adb from /Users/Manoj/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 5.0.1
[debug] [ADB] Setting device id to 4d0043fcb6a1a0ad
[ADB] Getting device platform version
[debug] [ADB] Getting connected devices…

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

[debug] [ADB] Running /Users/Manoj/Library/Android/sdk/platform-tools/adb with args: ["-P",5037,"-s",“4d0043fcb6a1a0ad”,“shell”,“getprop”,“ro.build.version.release”]

[AndroidDriver] Using device: 4d0043fcb6a1a0ad

[ADB] Checking whether adb is present

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

[debug] [ADB] Setting device id to 4d0043fcb6a1a0ad
[AndroidDriver] App file was not listed, instead we’re going to run com.android.chrome directly on the device

[debug] [AndroidDriver] Checking whether package is present on the device
[debug] [ADB] Getting connected devices…

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

[debug] [ADB] Running /Users/Manoj/Library/Android/sdk/platform-tools/adb with args: ["-P",5037,"-s",“4d0043fcb6a1a0ad”,“shell”,“pm”,“list”,“packages”,“com.android.chrome”]

[AndroidDriver] Starting Android session

[debug] [ADB] Running /Users/Manoj/Library/Android/sdk/platform-tools/adb with args: ["-P",5037,"-s",“4d0043fcb6a1a0ad”,“wait-for-device”]

[debug] [ADB] Getting connected devices…

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

[debug] [ADB] Running /Users/Manoj/Library/Android/sdk/platform-tools/adb with args: ["-P",5037,"-s",“4d0043fcb6a1a0ad”,“shell”,“echo”,“ping”]

[debug] [Logcat] Starting logcat capture

[debug] [AndroidDriver] Pushing settings apk to device…

[debug] [ADB] Running /Users/Manoj/Library/Android/sdk/platform-tools/adb with args: ["-P",5037,"-s",“4d0043fcb6a1a0ad”,“install”,"/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-android-driver/node_modules/io.appium.settings/bin/settings_apk-debug.apk"]

[debug] [AndroidDriver] Pushing unlock helper app to device…

[debug] [ADB] Running /Users/Manoj/Library/Android/sdk/platform-tools/adb with args: ["-P",5037,"-s",“4d0043fcb6a1a0ad”,“install”,"/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-android-driver/node_modules/appium-unlock/bin/unlock_apk-debug.apk"]

[ADB] Getting device platform version
[debug] [ADB] Getting connected devices…

[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running /Users/Manoj/Library/Android/sdk/platform-tools/adb with args: ["-P",5037,"-s",“4d0043fcb6a1a0ad”,“shell”,“getprop”,“ro.build.version.release”]

[debug] [ADB] Getting connected devices…

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

[debug] [ADB] Running /Users/Manoj/Library/Android/sdk/platform-tools/adb with args: ["-P",5037,"-s",“4d0043fcb6a1a0ad”,“shell”,“dumpsys”,“window”]

[AndroidDriver] Screen already unlocked, doing nothing

[debug] [AndroidBootstrap] Watching for bootstrap disconnect

[debug] [ADB] Forwarding system: 4724 to device: 4724

[debug] [ADB] Running /Users/Manoj/Library/Android/sdk/platform-tools/adb with args: ["-P",5037,"-s",“4d0043fcb6a1a0ad”,“forward”,“tcp:4724”,“tcp:4724”]

[debug] [UiAutomator] Starting UiAutomator
[debug] [UiAutomator] Moving to state ‘starting’
[debug] [UiAutomator] Parsing uiautomator jar
[debug] [UiAutomator] Found jar name: ‘AppiumBootstrap.jar’

[debug] [ADB] Running /Users/Manoj/Library/Android/sdk/platform-tools/adb with args: ["-P",5037,"-s",“4d0043fcb6a1a0ad”,“push”,"/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-android-driver/node_modules/appium-android-bootstrap/bootstrap/bin/AppiumBootstrap.jar","/data/local/tmp/"]

[debug] [ADB] Attempting to kill all uiautomator processes

[debug] [ADB] Getting all processes with uiautomator

[debug] [ADB] Getting connected devices…

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

[debug] [ADB] Running /Users/Manoj/Library/Android/sdk/platform-tools/adb with args: ["-P",5037,"-s",“4d0043fcb6a1a0ad”,“shell”,“ps”,“uiautomator”]

[ADB] No uiautomator process found to kill, continuing…

[debug] [UiAutomator] Starting UIAutomator
[debug] [ADB] Creating ADB subprocess with args: -P, 5037, -s, 4d0043fcb6a1a0ad, shell, uiautomator, runtest, AppiumBootstrap.jar, -c, io.appium.android.bootstrap.Bootstrap, -e, pkg, com.android.chrome, -e, disableAndroidWatchers, false, -e, acceptSslCerts, false

[debug] [UiAutomator] Moving to state ‘online’

[AndroidBootstrap] [BOOTSTRAP LOG] [debug] json loading complete.

[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Registered crash watchers.
[AndroidBootstrap] Android bootstrap socket is now connected
[AndroidDriver] Starting a chrome-based browser session

[debug] [Chromedriver] Changed state to ‘starting’

[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Client connected

[Chromedriver] Set chromedriver binary as: /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-android-driver/node_modules/appium-chromedriver/chromedriver/mac/chromedriver

[Chromedriver] Killing any old chromedrivers, running: pkill -15 -f “/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-android-driver/node_modules/appium-chromedriver/chromedriver/mac/chromedriver.*–port=9515”

[Chromedriver] No old chromedrivers seemed to exist

[Chromedriver] Spawning chromedriver with: /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-android-driver/node_modules/appium-chromedriver/chromedriver/mac/chromedriver --url-base=wd/hub --port=9515 --adb-port=5037

[Chromedriver] [STDOUT] Starting ChromeDriver 2.21.371459 (36d3d07f660ff2bc1bf28a75d1cdabed0983e7c4) on port 9515
Only local connections are allowed.

[JSONWP Proxy] Proxying [GET /status] to [GET http://127.0.0.1:9515/wd/hub/status] with no body

[Chromedriver] [STDERR] [warn] kq_init: detected broken kqueue; not using.: Undefined error: 0

[JSONWP Proxy] Got response with status 200: “{“sessionId”:”","stat…

[JSONWP Proxy] Proxying [POST /session] to [POST http://127.0.0.1:9515/wd/hub/session] with body: {“desiredCapabilities”:{"ch…

[JSONWP Proxy] Got response with status 200: {“sessionId”:"7492917150fb6…

[debug] [Chromedriver] Changed state to ‘online’

[Appium] New AndroidDriver session created successfully, session 38dc7c23-c737-4b34-987a-f13eb29e1fad added to master session list

[MJSONWP] Responding to client with driver.createSession() result: {“platform”:“LINUX”,"webSto…
[HTTP] <-- POST /wd/hub/session 200 19475 ms - 641

[HTTP] --> POST /wd/hub/session/38dc7c23-c737-4b34-987a-f13eb29e1fad/url {“url”:“https://www.udemy.com”}

[MJSONWP] Driver proxy active, passing request on via HTTP proxy

[JSONWP Proxy] Proxying [POST /wd/hub/session/38dc7c23-c737-4b34-987a-f13eb29e1fad/url] to [POST http://127.0.0.1:9515/wd/hub/session/7492917150fb6aaa1f971554ce3f6cb8/url] with body: {“url”:"https://www.udemy.c

[JSONWP Proxy] Got response with status 200: {“sessionId”:"7492917150fb6…

[JSONWP Proxy] Replacing sessionId 7492917150fb6aaa1f971554ce3f6cb8 with 38dc7c23-c737-4b34-987a-f13eb29e1fad

[HTTP] <-- POST /wd/hub/session/38dc7c23-c737-4b34-987a-f13eb29e1fad/url 200 118 ms - 220

[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 35 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 39 ms - 83

/bin/bash: shell_session_update: command not found

Code Executed:
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(MobileCapabilityType.PLATFORM_NAME, MobilePlatform.ANDROID);
capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, “4d0043fcb6a1a0ad”);
capabilities.setCapability(MobileCapabilityType.BROWSER_NAME, “Chrome”);
capabilities.setCapability(MobileCapabilityType.NEW_COMMAND_TIMEOUT, “600”);

	AndroidDriver wd = new AndroidDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);
	
	System.out.println("Navigating to udemy");
	wd.get("https://www.udemy.com");
	System.out.println("Lauchned successfully");
	wd.findElement(By.xpath("//input[@type='search']")).sendKeys("SoapUI");
	wd.findElement(By.xpath("//input[@type='search']")).sendKeys(Keys.ENTER);
	System.out.println(wd.getTitle());

Regards,
Manoj

@manovnk - Hi, Did you get this sorted it out? . if yes please help me with the resolution.

Thanks

No @sivashankar.st47. I read in few blogs that this issue has been resolved with latest appium version 1.6.3 but i haven’t tried yet

Thanks @manovnk , i dont see this issue with native browser in the emulator.

Hi
Even am facing the same issue. Can u help me with the solution.Am able to launch the default browser, but unable to launch the chrome browser

Hi,

It worked for me when i used the latest Appium Version. Try using the Appium Desktop 1.0.0 beta software which runs the 1.6.4 server.