2
votes

Launching Appium server with command: C:\Program Files (x86)\Appium\node.exe lib\server\main.js --address 127.0.0.1 --port 4723 --platform-name Android --platform-version 23 --automation-name Appium --log-no-color info: Welcome to Appium v1.4.16 (REV ae6877eff263066b26328d457bd285c0cc62430d) info: Appium REST http interface listener started on 127.0.0.1:4723 info: [debug] Non-default server args: {"address":"127.0.0.1","logNoColors":true,"platformName":"Android","platformVersion":"23","automationName":"Appium"} info: Console LogLevel: debug info: --> POST /wd/hub/session {"desiredCapabilities":{"appPackage":"com.Honkampkrueger.hk","appActivity":".MainActivity","app":"C:\Users\kuldeep.sahu\workspace\AppiumIntro\Src\honkamp.apk","browserName":"","platformName":"Android","deviceName":"Android Emulator","version":"4.4.2"}} info: Client User-Agent string: Apache-HttpClient/4.5.1 (Java/1.8.0_71) info: [debug] The following desired capabilities were provided, but not recognized by appium. They will be passed on to any other services running on this server. : version info: [debug] Using local app from desired caps: C:\Users\kuldeep.sahu\workspace\AppiumIntro\Src\honkamp.apk info: [debug] Creating new appium session f2eb01fe-7b8c-4e7c-89c6-5d776471a569 info: Starting android appium info: [debug] Getting Java version info: Java version is: 1.8.0_71 info: [debug] Checking whether adb is present info: [debug] Using adb from C:\Program Files\SDK\platform-tools\adb.exe info: [debug] Using fast reset? true info: [debug] Preparing device for session info: [debug] Checking whether app is actually present info: Retrieving device info: [debug] Trying to find a connected android device info: [debug] Getting connected devices... info: [debug] executing cmd: "C:\Program Files\SDK\platform-tools\adb.exe" devices info: [debug] 1 device(s) connected info: Found device emulator-5554 info: [debug] Setting device id to emulator-5554 info: [debug] Waiting for device to be ready and to respond to shell commands (timeout = 5) info: [debug] executing cmd: "C:\Program Files\SDK\platform-tools\adb.exe" -s emulator-5554 wait-for-device info: [debug] executing cmd: "C:\Program Files\SDK\platform-tools\adb.exe" -s emulator-5554 shell "echo 'ready'" info: [debug] Starting logcat capture info: [debug] Getting device API level info: [debug] executing cmd: "C:\Program Files\SDK\platform-tools\adb.exe" -s emulator-5554 shell "getprop ro.build.version.sdk" info: [debug] Device is at API Level 19 info: Device API level is: 19 info: [debug] Extracting strings for language: default info: [debug] executing cmd: "C:\Program Files\SDK\platform-tools\adb.exe" -s emulator-5554 shell "getprop persist.sys.language" info: [debug] Current device persist.sys.language: en info: [debug] java -jar "C:\Program Files (x86)\Appium\node_modules\appium\node_modules\appium-adb\jars\appium_apk_tools.jar" "stringsFromApk" "C:\Users\kuldeep.sahu\workspace\AppiumIntro\Src\honkamp.apk" "C:\Users\KULDEE~1.SAH\AppData\Local\Temp\com.Honkampkrueger.hk" en info: [debug] No strings.xml for language 'en', getting default strings.xml info: [debug] java -jar "C:\Program Files (x86)\Appium\node_modules\appium\node_modules\appium-adb\jars\appium_apk_tools.jar" "stringsFromApk" "C:\Users\kuldeep.sahu\workspace\AppiumIntro\Src\honkamp.apk" "C:\Users\KULDEE~1.SAH\AppData\Local\Temp\com.Honkampkrueger.hk" info: [debug] Reading strings from converted strings.json info: [debug] Setting language to default info: [debug] executing cmd: "C:\Program Files\SDK\platform-tools\adb.exe" -s emulator-5554 push "C:\Users\KULDEE~1.SAH\AppData\Local\Temp\com.Honkampkrueger.hk\strings.json" /data/local/tmp info: [debug] Checking whether aapt is present info: [debug] Using aapt from C:\Program Files\SDK\build-tools\23.0.2\aapt.exe info: [debug] Retrieving process from manifest. info: [debug] executing cmd: "C:\Program Files\SDK\build-tools\23.0.2\aapt.exe" dump xmltree C:\Users\kuldeep.sahu\workspace\AppiumIntro\Src\honkamp.apk AndroidManifest.xml info: [debug] Set app process to: com.Honkampkrueger.hk info: [debug] Not uninstalling app since server not started with --full-reset info: [debug] Checking app cert for C:\Users\kuldeep.sahu\workspace\AppiumIntro\Src\honkamp.apk. info: [debug] executing cmd: java -jar "C:\Program Files (x86)\Appium\node_modules\appium\node_modules\appium-adb\jars\verify.jar" C:\Users\kuldeep.sahu\workspace\AppiumIntro\Src\honkamp.apk info: [debug] App already signed. info: [debug] Zip-aligning C:\Users\kuldeep.sahu\workspace\AppiumIntro\Src\honkamp.apk info: [debug] Checking whether zipalign is present info: [debug] Using zipalign from C:\Program Files\SDK\build-tools\23.0.2\zipalign.exe info: [debug] Zip-aligning apk. info: [debug] executing cmd: "C:\Program Files\SDK\build-tools\23.0.2\zipalign.exe" -f 4 C:\Users\kuldeep.sahu\workspace\AppiumIntro\Src\honkamp.apk C:\Users\KULDEE~1.SAH\AppData\Local\Temp\11615-3480-14zot2k\appium.tmp info: [debug] MD5 for app is 91f72bc7e64a758cdb9d0b8414bd853c info: [debug] executing cmd: "C:\Program Files\SDK\platform-tools\adb.exe" -s emulator-5554 shell "ls /data/local/tmp/91f72bc7e64a758cdb9d0b8414bd853c.apk" info: [debug] Getting install status for com.Honkampkrueger.hk info: [debug] Getting device API level info: [debug] executing cmd: "C:\Program Files\SDK\platform-tools\adb.exe" -s emulator-5554 shell "getprop ro.build.version.sdk" info: [debug] Device is at API Level 19 info: [debug] executing cmd: "C:\Program Files\SDK\platform-tools\adb.exe" -s emulator-5554 shell "pm list packages -3 com.Honkampkrueger.hk" info: [debug] App is not installed info: Installing App info: [debug] executing cmd: "C:\Program Files\SDK\platform-tools\adb.exe" -s emulator-5554 shell "mkdir -p /data/local/tmp/" info: [debug] Removing any old apks info: [debug] executing cmd: "C:\Program Files\SDK\platform-tools\adb.exe" -s emulator-5554 shell "ls /data/local/tmp/*.apk" info: [debug] Found an apk we want to keep at /data/local/tmp/91f72bc7e64a758cdb9d0b8414bd853c.apk info: [debug] Couldn't find any apks to remove info: [debug] Uninstalling com.Honkampkrueger.hk info: [debug] executing cmd: "C:\Program Files\SDK\platform-tools\adb.exe" -s emulator-5554 shell "am force-stop com.Honkampkrueger.hk" info: [debug] executing cmd: "C:\Program Files\SDK\platform-tools\adb.exe" -s emulator-5554 uninstall com.Honkampkrueger.hk info: [debug] App was not uninstalled, maybe it wasn't on device? info: [debug] executing cmd: "C:\Program Files\SDK\platform-tools\adb.exe" -s emulator-5554 shell "pm install -r /data/local/tmp/91f72bc7e64a758cdb9d0b8414bd853c.apk" info: [debug] Forwarding system:4724 to device:4724 info: [debug] executing cmd: "C:\Program Files\SDK\platform-tools\adb.exe" -s emulator-5554 forward tcp:4724 tcp:4724 info: [debug] Pushing appium bootstrap to device... info: [debug] executing cmd: "C:\Program Files\SDK\platform-tools\adb.exe" -s emulator-5554 push "C:\Program Files (x86)\Appium\node_modules\appium\build\android_bootstrap\AppiumBootstrap.jar" /data/local/tmp/ info: [debug] Pushing settings apk to device... info: [debug] executing cmd: "C:\Program Files\SDK\platform-tools\adb.exe" -s emulator-5554 install "C:\Program Files (x86)\Appium\node_modules\appium\build\settings_apk\settings_apk-debug.apk" info: [debug] Pushing unlock helper app to device... info: [debug] executing cmd: "C:\Program Files\SDK\platform-tools\adb.exe" -s emulator-5554 install "C:\Program Files (x86)\Appium\node_modules\appium\build\unlock_apk\unlock_apk-debug.apk" info: Starting App info: [debug] Attempting to kill all 'uiautomator' processes info: [debug] Getting all processes with 'uiautomator' info: [debug] executing cmd: "C:\Program Files\SDK\platform-tools\adb.exe" -s emulator-5554 shell "ps 'uiautomator'" info: [debug] No matching processes found info: [debug] Running bootstrap info: [debug] spawning: C:\Program Files\SDK\platform-tools\adb.exe -s emulator-5554 shell uiautomator runtest AppiumBootstrap.jar -c io.appium.android.bootstrap.Bootstrap -e pkg com.Honkampkrueger.hk -e disableAndroidWatchers false info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_RESULT: shortMsg=java.lang.NullPointerException info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_RESULT: longMsg=null info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_CODE: 0 info: [debug] UiAutomator exited info: [debug] executing cmd: "C:\Program Files\SDK\platform-tools\adb.exe" -s emulator-5554 shell "echo 'ping'" info: [debug] Attempting to uninstall app info: [debug] Not uninstalling app since server not started with --full-reset info: [debug] Cleaning up android objects info: [debug] Cleaning up appium session error: UiAutomator quit before it successfully launched error: Failed to start an Appium session, err was: Error: UiAutomator quit before it successfully launched info: [debug] Error: UiAutomator quit before it successfully launched at [object Object]. (C:\Program Files (x86)\Appium\node_modules\appium\lib\devices\android\android.js:205:23) at [object Object]. (C:\Program Files (x86)\Appium\node_modules\appium\lib\devices\android\android-hybrid.js:249:5) at Object.async.eachSeries (C:\Program Files (x86)\Appium\node_modules\appium\node_modules\async\lib\async.js:142:20) at [object Object].androidHybrid.stopChromedriverProxies (C:\Program Files (x86)\Appium\node_modules\appium\lib\devices\android\android-hybrid.js:233:9) at [object Object]. (C:\Program Files (x86)\Appium\node_modules\appium\lib\devices\android\android.js:200:10) at [object Object]. (C:\Program Files (x86)\Appium\node_modules\appium\lib\devices\android\android.js:222:9) at [object Object].androidCommon.uninstallApp (C:\Program Files (x86)\Appium\node_modules\appium\lib\devices\android\android-common.js:478:5) at [object Object]. (C:\Program Files (x86)\Appium\node_modules\appium\lib\devices\android\android.js:220:12) at [object Object]. (C:\Program Files (x86)\Appium\node_modules\appium\lib\devices\android\android.js:229:11) at C:\Program Files (x86)\Appium\node_modules\appium\node_modules\appium-adb\lib\adb.js:901:7 at [object Object]. (C:\Program Files (x86)\Appium\node_modules\appium\node_modules\appium-adb\lib\adb.js:180:9) at ChildProcess.exithandler (child_process.js:742:7) at ChildProcess.emit (events.js:110:17) at maybeClose (child_process.js:1016:16) at Process.ChildProcess._handle.onexit (child_process.js:1088:5) info: [debug] Responding to client with error: {"status":33,"value":{"message":"A new session could not be created. (Original error: UiAutomator quit before it successfully launched)","origValue":"UiAutomator quit before it successfully launched"},"sessionId":null} info: <-- POST /wd/hub/session 500 46111.400 ms - 218

Error : Exception in thread "main" org.openqa.selenium.SessionNotCreatedException: A new session could not be created. (Original error: UiAutomator quit before it successfully launched) (WARNING: The server did not provide any stacktrace information).

Anyone have solution of this as My running emulator is very slow to launch.

3
seems like every question at your end is incomplete without the slow to launch .. you might want to get better hardware configurations to work on in which case.Naman

3 Answers

1
votes

UiAutomator quit before it successfully launched error: Failed to start an Appium session, err was: Error: UiAutomator quit before it successfully launched info: [debug] Error: UiAutomator quit before it successfully launched at [object Object]. (C:\Program Files (x86)\Appium\node_modules\appium\lib\devices\android\android.js:205:23) at [object Object].

These suggests that UIAutomator did not launch due to which Appium session was not created. [SessionNotCreatedException on your IDE] Restarting adb server and appium serve shall help you.

Prior to that you can also try running the UIAutomator using shell to verify if its working alright on your machine.

0
votes

In case you using Appium 1.4 + version to automate android (7.0 / N / Nougat ) version, this issue persists. you have to make couple of changes to get this working properly.

We had a similar issue, when we started to automate a simple mobile application using appium, android studio and selenium webdriver, after so many searches and also looking at various appium support tickets, we found that it was a bug and they have given an alternative to fix and go ahead.

You have to change code in couple of places in following file: C:\Program Files (x86)\Appium\node_modules\appium\node_modules\appium-adb\lib\adb.js

Those details have been listed in below article: http://www.testingtools.co/appium/error-command-failed-adb-exe-s-emulator-5554-shell-ps-uiautomator

Hope it helps you, in case you have any queries, you can post them over the blog article in form of comments as well.

0
votes

You cannot run UIAutomator and Appium server in parallel, this is known issue. Make sure your Appium server is stopped before you run your UIAutomator then try again. This should work.