{"action":"created","issue":{"url":"https://api.github.com/repos/appium/appium/issues/2841","labels_url":"https://api.github.com/repos/appium/appium/issues/2841/labels{/name}","comments_url":"https://api.github.com/repos/appium/appium/issues/2841/comments","events_url":"https://api.github.com/repos/appium/appium/issues/2841/events","html_url":"https://github.com/appium/appium/issues/2841","id":35614189,"number":2841,"title":"[Android, help] Stock Browser closes immediately when AVD starts on lock screen","user":{"login":"haubey","id":224066,"avatar_url":"https://avatars.githubusercontent.com/u/224066?v=3","gravatar_id":"","url":"https://api.github.com/users/haubey","html_url":"https://github.com/haubey","followers_url":"https://api.github.com/users/haubey/followers","following_url":"https://api.github.com/users/haubey/following{/other_user}","gists_url":"https://api.github.com/users/haubey/gists{/gist_id}","starred_url":"https://api.github.com/users/haubey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/haubey/subscriptions","organizations_url":"https://api.github.com/users/haubey/orgs","repos_url":"https://api.github.com/users/haubey/repos","events_url":"https://api.github.com/users/haubey/events{/privacy}","received_events_url":"https://api.github.com/users/haubey/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/appium/appium/milestones/17","html_url":"https://github.com/appium/appium/milestones/Bugs","labels_url":"https://api.github.com/repos/appium/appium/milestones/17/labels","id":1034713,"number":17,"title":"Bugs","description":"","creator":{"login":"jlipps","id":605053,"avatar_url":"https://avatars.githubusercontent.com/u/605053?v=3","gravatar_id":"","url":"https://api.github.com/users/jlipps","html_url":"https://github.com/jlipps","followers_url":"https://api.github.com/users/jlipps/followers","following_url":"https://api.github.com/users/jlipps/following{/other_user}","gists_url":"https://api.github.com/users/jlipps/gists{/gist_id}","starred_url":"https://api.github.com/users/jlipps/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jlipps/subscriptions","organizations_url":"https://api.github.com/users/jlipps/orgs","repos_url":"https://api.github.com/users/jlipps/repos","events_url":"https://api.github.com/users/jlipps/events{/privacy}","received_events_url":"https://api.github.com/users/jlipps/received_events","type":"User","site_admin":false},"open_issues":100,"closed_issues":1,"state":"open","created_at":"2015-03-23T17:37:36Z","updated_at":"2015-05-05T18:11:25Z","due_on":null,"closed_at":null},"comments":17,"created_at":"2014-06-12T19:12:38Z","updated_at":"2015-05-05T21:44:46Z","closed_at":null,"body":"Hi everybody, I've been playing around with Appium, and I've run into an issue. When I'm testing the stock browser in an emulator, starting from when the screen is locked, I see the screen unlock, the browser open, the screen lock, the browser open, and then finally the device goes to the home page, and after a few seconds Appium returns that it couldn't get a redirect from Chromedriver. Then, while the device is on the home screen, if I try to run my tests again, the same thing happens, but I get a slightly different log message. If I restart the emulator an unlock it manually before running the tests, the browser opens and the tests will work.\r\n\r\nI'm running on an x86 emulator with HAXM on OSX 10.9, and my tests are running on a Windows machine (they're written in C#).. I've also run into this issue on non HAXM, and on an ARM emulator. I installed Appium from npm, and am running version 1.1.0.\r\n\r\nMy capabilities are\r\n```\r\n    capabilities.SetCapability(\"appium-version\", \"1.1\");\r\n    capabilities.SetCapability(\"platformName\", \"Android\");\r\n    capabilities.SetCapability(\"deviceName\", \"Android Emulator\");\r\n    capabilities.SetCapability(\"platformVersion\", \"4.4\");\r\n    capabilities.SetCapability(\"browserName\", \"Browser\");\r\n```\r\n\r\nHere are the logs from Appium:\r\n```\r\ninfo: [ADB] Waiting for device to be ready and to respond to shell commands (timeout = 5)\r\ndebug: executing: \"/Users/ultilab/android-sdk/platform-tools/adb\" -s emulator-5554 wait-for-device\r\ndebug: executing: \"/Users/ultilab/android-sdk/platform-tools/adb\" -s emulator-5554 shell \"echo 'ready'\"\r\ninfo: Starting logcat capture\r\ndebug: Pushing unlock helper app to device...\r\ndebug: executing: \"/Users/ultilab/android-sdk/platform-tools/adb\" -s emulator-5554 install \"/usr/local/lib/node_modules/appium/build/unlock_apk/unlock_apk-debug.apk\"\r\ndebug: executing: \"/Users/ultilab/android-sdk/platform-tools/adb\" -s emulator-5554 shell \"dumpsys window\"\r\ninfo: Writing dumpsys output to /usr/local/lib/node_modules/appium/.dumpsys.log\r\ndebug: Screen is locked, trying to unlock\r\ndebug: executing: \"/Users/ultilab/android-sdk/platform-tools/adb\" -s emulator-5554 shell \"am start -S -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -f 0x10200000 -n io.appium.unlock/.Unlock\"\r\ndebug: executing: \"/Users/ultilab/android-sdk/platform-tools/adb\" -s emulator-5554 shell \"dumpsys window\"\r\ninfo: Writing dumpsys output to /usr/local/lib/node_modules/appium/.dumpsys.log\r\ndebug: Screen is locked, trying to unlock\r\ndebug: executing: \"/Users/ultilab/android-sdk/platform-tools/adb\" -s emulator-5554 shell \"am start -S -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -f 0x10200000 -n io.appium.unlock/.Unlock\"\r\ndebug: executing: \"/Users/ultilab/android-sdk/platform-tools/adb\" -s emulator-5554 shell \"dumpsys window\"\r\ninfo: Writing dumpsys output to /usr/local/lib/node_modules/appium/.dumpsys.log\r\ndebug: Screen is unlocked, continuing\r\ninfo: Creating Chrome session\r\ninfo: Ensuring Chromedriver exists\r\ninfo: Killing any old chromedrivers, running: ps -e | grep /usr/local/lib/node_modules/appium/build/chromedriver/mac/chromedriver | grep -v grep |grep -e '--port=9515$' | awk '{ print $1 }' | xargs kill -15\r\ninfo: Successfully cleaned up old chromedrivers\r\ninfo: Spawning chromedriver with: /usr/local/lib/node_modules/appium/build/chromedriver/mac/chromedriver\r\ninfo: [CHROMEDRIVER] Starting ChromeDriver (v2.9.248307) on port 9515\r\ninfo: Making http request with opts: {\"url\":\"http://127.0.0.1:9515/wd/hub/session\",\"method\":\"POST\",\"json\":{\"sessionId\":null,\"desiredCapabilities\":{\"chromeOptions\":{\"androidPackage\":\"com.android.browser\",\"androidActivity\":\"com.android.browser.BrowserActivity\",\"androidDeviceSerial\":\"emulator-5554\"}}}}\r\ninfo: Could not connect yet; retrying\r\ninfo: Making http request with opts: {\"url\":\"http://127.0.0.1:9515/wd/hub/session\",\"method\":\"POST\",\"json\":{\"sessionId\":null,\"desiredCapabilities\":{\"chromeOptions\":{\"androidPackage\":\"com.android.browser\",\"androidActivity\":\"com.android.browser.BrowserActivity\",\"androidDeviceSerial\":\"emulator-5554\"}}}}\r\nerror: Chromedriver create session did not work. Status was 200 and body was {\"sessionId\":\"bd0cf2d3e1f435ca63d3e932122aa1af\",\"status\":21,\"value\":{\"message\":\"timeout: Adb command timed out after 30 seconds\\n  (Driver info: chromedriver=2.9.248307,platform=Mac OS X 10.9.3 x86_64)\"}}\r\ninfo: Cleaning up appium session\r\n```\r\n\r\nAnd when you run it after that,\r\n\r\n```\r\ndebug: Screen already unlocked, continuing.\r\ninfo: Creating Chrome session\r\ninfo: Ensuring Chromedriver exists\r\ninfo: Killing any old chromedrivers, running: ps -e | grep /usr/local/lib/node_modules/appium/build/chromedriver/mac/chromedriver | grep -v grep |grep -e '--port=9515$' | awk '{ print $1 }' | xargs kill -15\r\ninfo: Chromedriver exited with code null\r\ninfo: (killed by signal SIGTERM)\r\ninfo: [ADB] Getting connected devices...\r\ndebug: executing: \"/Users/ultilab/android-sdk/platform-tools/adb\" -s emulator-5554 devices\r\ninfo: Successfully cleaned up old chromedrivers\r\ninfo: Spawning chromedriver with: /usr/local/lib/node_modules/appium/build/chromedriver/mac/chromedriver\r\ninfo: [ADB] 1 device(s) connected\r\ndebug: executing: \"/Users/ultilab/android-sdk/platform-tools/adb\" -s emulator-5554 shell \"am force-stop com.android.browser\"\r\ninfo: [CHROMEDRIVER] Starting ChromeDriver (v2.9.248307) on port 9515\r\ninfo: Making http request with opts: {\"url\":\"http://127.0.0.1:9515/wd/hub/session\",\"method\":\"POST\",\"json\":{\"sessionId\":null,\"desiredCapabilities\":{\"chromeOptions\":{\"androidPackage\":\"com.android.browser\",\"androidActivity\":\"com.android.browser.BrowserActivity\",\"androidDeviceSerial\":\"emulator-5554\"}}}}\r\ninfo: Could not connect yet; retrying\r\ninfo: Making http request with opts: {\"url\":\"http://127.0.0.1:9515/wd/hub/session\",\"method\":\"POST\",\"json\":{\"sessionId\":null,\"desiredCapabilities\":{\"chromeOptions\":{\"androidPackage\":\"com.android.browser\",\"androidActivity\":\"com.android.browser.BrowserActivity\",\"androidDeviceSerial\":\"emulator-5554\"}}}}\r\ninfo: Cleaning up appium session\r\n```\r\n\r\nPlease let me know if you need anything else, and thanks for your help!"},"comment":{"url":"https://api.github.com/repos/appium/appium/issues/comments/99232700","html_url":"https://github.com/appium/appium/issues/2841#issuecomment-99232700","issue_url":"https://api.github.com/repos/appium/appium/issues/2841","id":99232700,"user":{"login":"moizjv","id":1308607,"avatar_url":"https://avatars.githubusercontent.com/u/1308607?v=3","gravatar_id":"","url":"https://api.github.com/users/moizjv","html_url":"https://github.com/moizjv","followers_url":"https://api.github.com/users/moizjv/followers","following_url":"https://api.github.com/users/moizjv/following{/other_user}","gists_url":"https://api.github.com/users/moizjv/gists{/gist_id}","starred_url":"https://api.github.com/users/moizjv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/moizjv/subscriptions","organizations_url":"https://api.github.com/users/moizjv/orgs","repos_url":"https://api.github.com/users/moizjv/repos","events_url":"https://api.github.com/users/moizjv/events{/privacy}","received_events_url":"https://api.github.com/users/moizjv/received_events","type":"User","site_admin":false},"created_at":"2015-05-05T21:44:46Z","updated_at":"2015-05-05T21:44:46Z","body":"Similar issue https://github.com/appium/appium/issues/4689 Tracking it here"}}