How to automate multiple android devices

appium - 1.2.2
java bindings - 1.6.2
OS - Windows 7(x64)

Below is the code

DesiredCapabilities capabilities = new DesiredCapabilities();
//capabilities.setCapability(“automationName”, “Appium”);
//capabilities.setCapability(“deviceName”,“Android”);
// capabilities.setCapability(“platformName”,“Android”);
// capabilities.setCapability(CapabilityType.VERSION, “4.4.2”);
// capabilities.setCapability(“appPackage”, “com.android.settings”);
//capabilities.setCapability(“appActivity”, “.Settings”);

      capabilities.setCapability("appPackage", "com.vcast.mediamanager");
     capabilities.setCapability("appActivity", ".gui.activities.SplashLogoActivity");
   // capabilities.setCapability("autoLaunch", "false");
     //capabilities.setCapability("app","chrome");
     capabilities.setCapability(MobileCapabilityType.PLATFORM_NAME, "Android");
     capabilities.setCapability(MobileCapabilityType.PLATFORM_VERSION, "4.4.2");
     capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, "Nexus5");
   // capabilities.setCapability(MobileCapabilityType.BROWSER_NAME, "Chrome");
     
     driver = new AppiumDriver(new URL("http://0.0.0.0:4723/wd/hub"), capabilities);
           
     DesiredCapabilities capabilities1 = new DesiredCapabilities();
     capabilities1.setCapability("appPackage", "com.android.settings");
     capabilities1.setCapability("appActivity", ".Settings");
   // capabilities.setCapability("autoLaunch", "false");
     //capabilities.setCapability("app","chrome");
     capabilities1.setCapability(MobileCapabilityType.PLATFORM_NAME, "Android");
     capabilities1.setCapability(MobileCapabilityType.PLATFORM_VERSION, "4.4.2");
     capabilities1.setCapability(MobileCapabilityType.DEVICE_NAME, "Galaxy S4");
     
     driver1 = new AppiumDriver(new URL("http://0.0.0.0:4724/wd/hub"), capabilities);

But same app is launched in both the cases the app launched in driver is launched?

Following is log for appium 4723 driver:
ar -c io.appium.android.bootstrap.Bootstrap
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=UiAutomatorTestRun
ner
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: test=testRunServer
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: class=io.appium.andro
id.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] Waking up device if it’s not alive
info: [debug] Pushing command to appium work queue: [“wake”,{}]
info: [debug] [BOOTSTRAP] [debug] Registered crash watchers.
info: [debug] [BOOTSTRAP] [debug] Client connected
info: [debug] [BOOTSTRAP] [debug] Got data from client: {“cmd”:“action”,“action”
:“wake”,“params”:{}}
info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
info: [debug] [BOOTSTRAP] [debug] Got command action: wake
info: [debug] [BOOTSTRAP] [debug] Returning result: {“value”:true,“status”:0}
info: [debug] executing: “E:\Automation\MobileAutomation\adt\adt-bundle\sdk\plat
form-tools\adb.exe” -s 077c35ee0ade546b shell “dumpsys window”
info: [debug] Writing dumpsys output to C:\Users\Raghuram\AppData\Roaming\npm\no
de_modules\appium.dumpsys.log
info: [debug] Screen already unlocked, continuing.
info: [debug] Pushing command to appium work queue: [“getDataDir”,{}]
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] [BOOTSTRAP] [debug] Returning result: {“value”:"/data/local/tmp
“,“status”:0}
info: [debug] dataDir set to: /data/local/tmp
info: [debug] Getting device API level
info: [debug] executing: “E:\Automation\MobileAutomation\adt\adt-bundle\sdk\plat
form-tools\adb.exe” -s 077c35ee0ade546b shell “getprop ro.build.version.sdk”
info: [debug] Device is at API Level 19
info: [debug] executing: “E:\Automation\MobileAutomation\adt\adt-bundle\sdk\plat
form-tools\adb.exe” -s 077c35ee0ade546b shell “am start -S -a android.intent.act
ion.MAIN -c android.intent.category.LAUNCHER -f 0x10200000 -n com.vcast.mediaman
ager/.gui.activities.SplashLogoActivity”
info: [debug] Waiting for pkg “com.vcast.mediamanager” and activity “.gui.activi
ties.SplashLogoActivity” to be focused
info: [debug] Getting focused package and activity
info: [debug] executing: “E:\Automation\MobileAutomation\adt\adt-bundle\sdk\plat
form-tools\adb.exe” -s 077c35ee0ade546b shell “dumpsys window windows”
info: [debug] Device launched! Ready for commands
info: [debug] Setting command timeout to the default of 60 secs
info: [debug] Appium session started with sessionId 41b692f6-483c-422a-9905-a4ed
f7118800
info: <-- POST /wd/hub/session 303 3851.300 ms - 9
info: --> GET /wd/hub/session/41b692f6-483c-422a-9905-a4edf7118800 {}
info: [debug] Responding to client with success: {“status”:0,“value”:{“platform”
:“LINUX”,“browserName”:“Android”,“platformVersion”:“4.4.2”,“webStorageEnabled”:f
alse,“takesScreenshot”:true,“javascriptEnabled”:true,“databaseEnabled”:false,“ne
tworkConnectionEnabled”:true,“locationContextEnabled”:false,“warnings”:{},“desir
ed”:{“appPackage”:“com.vcast.mediamanager”,“appActivity”:”.gui.activities.Splash
LogoActivity",“platformVersion”:“4.4.2”,“platformName”:“Android”,“deviceName”:“N
exus5”},“appPackage”:“com.vcast.mediamanager”,“appActivity”:".gui.activities.Spl
ashLogoActivity",“platformName”:“Android”,“deviceName”:“Nexus5”},“sessionId”:“41
b692f6-483c-422a-9905-a4edf7118800”}
info: <-- GET /wd/hub/session/41b692f6-483c-422a-9905-a4edf7118800 200 3.945 ms

  • 627 {“status”:0,“value”:{“platform”:“LINUX”,“browserName”:“Android”,“platformV
    ersion”:“4.4.2”,“webStorageEnabled”:false,“takesScreenshot”:true,“javascriptEnab
    led”:true,“databaseEnabled”:false,“networkConnectionEnabled”:true,“locationConte
    xtEnabled”:false,“warnings”:{},“desired”:{“appPackage”:“com.vcast.mediamanager”,
    “appActivity”:".gui.activities.SplashLogoActivity",“platformVersion”:“4.4.2”,“pl
    atformName”:“Android”,“deviceName”:“Nexus5”},“appPackage”:“com.vcast.mediamanage
    r”,“appActivity”:".gui.activities.SplashLogoActivity",“platformName”:“Android”,"
    deviceName":“Nexus5”},“sessionId”:“41b692f6-483c-422a-9905-a4edf7118800”}
    info: --> DELETE /wd/hub/session/41b692f6-483c-422a-9905-a4edf7118800 {}
    info: Shutting down appium session
    info: [debug] Pressing the HOME button
    info: [debug] executing: “E:\Automation\MobileAutomation\adt\adt-bundle\sdk\plat
    form-tools\adb.exe” -s 077c35ee0ade546b shell “input keyevent 3”
    info: [debug] Stopping logcat capture
    info: [debug] Logcat terminated with code null, signal SIGTERM
    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: {“value”:“OK, shutting down”
    ,“status”:0}
    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=UiAutomatorTestRun
    ner
    info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: test=testRunServer
    info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: class=io.appium.andro
    id.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: 1.898
    info: [debug] [UIAUTOMATOR STDOUT] OK (1 test)
    info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS_CODE: -1
    info: [debug] Sent shutdown command, waiting for UiAutomator to stop…
    info: [debug] UiAutomator shut down normally
    info: [debug] Cleaning up android objects
    info: [debug] Cleaning up appium session
    info: [debug] Responding to client with success: {“status”:0,“value”:null,“sessi
    onId”:“41b692f6-483c-422a-9905-a4edf7118800”}
    info: <-- DELETE /wd/hub/session/41b692f6-483c-422a-9905-a4edf7118800 200 710.18
    7 ms - 76 {“status”:0,“value”:null,“sessionId”:“41b692f6-483c-422a-9905-a4edf711
    8800”}
    info: --> POST /wd/hub/session {“desiredCapabilities”:{“appPackage”:“com.vcast.m
    ediamanager”,“appActivity”:".gui.activities.SplashLogoActivity","platformVersion
    ":“4.4.2”,“platformName”:“Android”,“deviceName”:“Nexus5”}}
    info: [debug] Didn’t get app but did get Android package, will attempt to launch
    it on the device
    info: [debug] Creating new appium session ea8cf1c0-d9a9-4dfa-bf18-fcef253ae765
    info: Starting android appium
    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 alr
    eady on the device
    info: [debug] Checking whether adb is present
    info: [debug] Using adb from E:\Automation\MobileAutomation\adt\adt-bundle\sdk\p
    latform-tools\adb.exe

info: Retrieving device
info: [debug] Trying to find a connected android device
info: [debug] Getting connected devices…
info: [debug] executing: “E:\Automation\MobileAutomation\adt\adt-bundle\sdk\plat
form-tools\adb.exe” devices
info: [debug] 2 device(s) connected
info: Found device 077c35ee0ade546b
info: [debug] Setting device id to 077c35ee0ade546b
info: [debug] Waiting for device to be ready and to respond to shell commands (t
imeout = 5)
info: [debug] executing: “E:\Automation\MobileAutomation\adt\adt-bundle\sdk\plat
form-tools\adb.exe” -s 077c35ee0ade546b wait-for-device
info: [debug] executing: “E:\Automation\MobileAutomation\adt\adt-bundle\sdk\plat
form-tools\adb.exe” -s 077c35ee0ade546b shell “echo ‘ready’”
info: [debug] Starting logcat capture
warn: No app capability, can’t parse package/activity
info: [debug] Getting device API level
info: [debug] executing: “E:\Automation\MobileAutomation\adt\adt-bundle\sdk\plat
form-tools\adb.exe” -s 077c35ee0ade546b shell “getprop ro.build.version.sdk”
info: [debug] Device is at API Level 19
info: Device API level is: 19
info: [debug] Apk doesn’t exist locally
info: [debug] executing: “E:\Automation\MobileAutomation\adt\adt-bundle\sdk\plat
form-tools\adb.exe” -s 077c35ee0ade546b shell “rm -rf /data/local/tmp/strings.js
on”
info: [debug] Not uninstalling app since server not started with --full-reset
info: [debug] Skipping install since we launched with a package instead of an ap
p path
info: [debug] Forwarding system:4724 to device:4724
info: [debug] executing: “E:\Automation\MobileAutomation\adt\adt-bundle\sdk\plat
form-tools\adb.exe” -s 077c35ee0ade546b forward tcp:4724 tcp:4724
info: [debug] Pushing appium bootstrap to device…
info: [debug] executing: “E:\Automation\MobileAutomation\adt\adt-bundle\sdk\plat
form-tools\adb.exe” -s 077c35ee0ade546b push “C:\Users\Raghuram\AppData\Roam
ing\npm\node_modules\appium\build\android_bootstrap\AppiumBootstrap.jar” /
data/local/tmp/
info: [debug] Pushing settings apk to device…
info: [debug] executing: “E:\Automation\MobileAutomation\adt\adt-bundle\sdk\plat
form-tools\adb.exe” -s 077c35ee0ade546b install “C:\Users\Raghuram\AppData\Roami
ng\npm\node_modules\appium\build\settings_apk\settings_apk-debug.apk”
info: [debug] Pushing unlock helper app to device…
info: [debug] executing: “E:\Automation\MobileAutomation\adt\adt-bundle\sdk\plat
form-tools\adb.exe” -s 077c35ee0ade546b install “C:\Users\Raghuram\AppData\Roami
ng\npm\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: “E:\Automation\MobileAutomation\adt\adt-bundle\sdk\plat
form-tools\adb.exe” -s 077c35ee0ade546b shell “ps ‘uiautomator’”
info: [debug] No matching processes found
info: [debug] Running bootstrap
info: [debug] spawning: E:\Automation\MobileAutomation\adt\adt-bundle\sdk\platfo
rm-tools\adb.exe -s 077c35ee0ade546b shell uiautomator runtest AppiumBootstrap.j
ar -c io.appium.android.bootstrap.Bootstrap
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=UiAutomatorTestRun
ner
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: test=testRunServer
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: class=io.appium.andro
id.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] Waking up device if it’s not alive
info: [debug] Pushing command to appium work queue: [“wake”,{}]
info: [debug] [BOOTSTRAP] [debug] Registered crash watchers.
info: [debug] [BOOTSTRAP] [debug] Client connected
info: [debug] [BOOTSTRAP] [debug] Got data from client: {“cmd”:“action”,“action”
:“wake”,“params”:{}}
info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
info: [debug] [BOOTSTRAP] [debug] Got command action: wake
info: [debug] [BOOTSTRAP] [debug] Returning result: {“value”:true,“status”:0}
info: [debug] executing: “E:\Automation\MobileAutomation\adt\adt-bundle\sdk\plat
form-tools\adb.exe” -s 077c35ee0ade546b shell “dumpsys window”
info: [debug] Writing dumpsys output to C:\Users\Raghuram\AppData\Roaming\npm\no
de_modules\appium.dumpsys.log
info: [debug] Screen already unlocked, continuing.
info: [debug] Pushing command to appium work queue: [“getDataDir”,{}]
info: [debug] [BOOTSTRAP] [debug] Got data from client: {“cmd”:“action”,“action”
:“getDataDir”,“params”:{}}
info: [debug] dataDir set to: /data/local/tmp
info: [debug] Getting device API level
info: [debug] executing: “E:\Automation\MobileAutomation\adt\adt-bundle\sdk\plat
form-tools\adb.exe” -s 077c35ee0ade546b shell “getprop ro.build.version.sdk”
info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
info: [debug] [BOOTSTRAP] [debug] Got command action: getDataDir
info: [debug] [BOOTSTRAP] [debug] Returning result: {“value”:"/data/local/tmp
“,“status”:0}
info: [debug] Device is at API Level 19
info: [debug] executing: “E:\Automation\MobileAutomation\adt\adt-bundle\sdk\plat
form-tools\adb.exe” -s 077c35ee0ade546b shell “am start -S -a android.intent.act
ion.MAIN -c android.intent.category.LAUNCHER -f 0x10200000 -n com.vcast.mediaman
ager/.gui.activities.SplashLogoActivity”
info: [debug] Waiting for pkg “com.vcast.mediamanager” and activity “.gui.activi
ties.SplashLogoActivity” to be focused
info: [debug] Getting focused package and activity
info: [debug] executing: “E:\Automation\MobileAutomation\adt\adt-bundle\sdk\plat
form-tools\adb.exe” -s 077c35ee0ade546b shell “dumpsys window windows”
info: [debug] Device launched! Ready for commands
info: [debug] Setting command timeout to the default of 60 secs
info: [debug] Appium session started with sessionId ea8cf1c0-d9a9-4dfa-bf18-fcef
253ae765
info: <-- POST /wd/hub/session 303 3996.987 ms - 9
info: --> GET /wd/hub/session/ea8cf1c0-d9a9-4dfa-bf18-fcef253ae765 {}
info: [debug] Responding to client with success: {“status”:0,“value”:{“platform”
:“LINUX”,“browserName”:“Android”,“platformVersion”:“4.4.2”,“webStorageEnabled”:f
alse,“takesScreenshot”:true,“javascriptEnabled”:true,“databaseEnabled”:false,“ne
tworkConnectionEnabled”:true,“locationContextEnabled”:false,“warnings”:{},“desir
ed”:{“appPackage”:“com.vcast.mediamanager”,“appActivity”:”.gui.activities.Splash
LogoActivity",“platformVersion”:“4.4.2”,“platformName”:“Android”,“deviceName”:“N
exus5”},“appPackage”:“com.vcast.mediamanager”,“appActivity”:".gui.activities.Spl
ashLogoActivity",“platformName”:“Android”,“deviceName”:“Nexus5”},“sessionId”:“ea
8cf1c0-d9a9-4dfa-bf18-fcef253ae765”}
info: <-- GET /wd/hub/session/ea8cf1c0-d9a9-4dfa-bf18-fcef253ae765 200 1.960 ms

  • 627 {“status”:0,“value”:{“platform”:“LINUX”,“browserName”:“Android”,“platformV
    ersion”:“4.4.2”,“webStorageEnabled”:false,“takesScreenshot”:true,“javascriptEnab
    led”:true,“databaseEnabled”:false,“networkConnectionEnabled”:true,“locationConte
    xtEnabled”:false,“warnings”:{},“desired”:{“appPackage”:“com.vcast.mediamanager”,
    “appActivity”:".gui.activities.SplashLogoActivity",“platformVersion”:“4.4.2”,“pl
    atformName”:“Android”,“deviceName”:“Nexus5”},“appPackage”:“com.vcast.mediamanage
    r”,“appActivity”:".gui.activities.SplashLogoActivity",“platformName”:“Android”,"
    deviceName":“Nexus5”},“sessionId”:“ea8cf1c0-d9a9-4dfa-bf18-fcef253ae765”}
    info: [debug] UiAutomator exited
    info: [debug] executing: “E:\Automation\MobileAutomation\adt\adt-bundle\sdk\plat
    form-tools\adb.exe” -s 077c35ee0ade546b 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 Chromedriver
    error: Unhandled error: TypeError: Object function () { [native code] } has no m
    ethod ‘stop’
    at androidHybrid.cleanupChromedriver (C:\Users\Raghuram\AppData\Roaming\npm
    node_modules\appium\lib\devices\android\android-hybrid.js:198:18)
    at null. (C:\Users\Raghuram\AppData\Roaming\npm\node_modules\appi
    um\lib\devices\android\android.js:186:10)
    at null. (C:\Users\Raghuram\AppData\Roaming\npm\node_modules\appi
    um\lib\devices\android\android.js:208:9)
    at androidCommon.uninstallApp (C:\Users\Raghuram\AppData\Roaming\npm\node_mo
    dules\appium\lib\devices\android\android-common.js:465:5)
    at null. (C:\Users\Raghuram\AppData\Roaming\npm\node_modules\appi
    um\lib\devices\android\android.js:206:12)
    at null. (C:\Users\Raghuram\AppData\Roaming\npm\node_modules\appi
    um\lib\devices\android\android.js:215:11)
    at C:\Users\Raghuram\AppData\Roaming\npm\node_modules\appium\node_modules\ap
    pium-adb\lib\adb.js:902:7
    at null. (C:\Users\Raghuram\AppData\Roaming\npm\node_modules\appi
    um\node_modules\appium-adb\lib\adb.js:173:9)
    at ChildProcess.exithandler (child_process.js:646:7)
    at ChildProcess.emit (events.js:98:17) context: [POST /wd/hub/session {“desi
    redCapabilities”:{“appPackage”:“com.vcast.mediamanager”,“appActivity”:".gui.acti
    vities.SplashLogoActivity",“platformVersion”:“4.4.2”,“platformName”:“Android”,“d
    eviceName”:“Nexus5”}}]
    info: --> GET /wd/hub/session/ea8cf1c0-d9a9-4dfa-bf18-fcef253ae765/source {}
    info: [debug] Pushing command to appium work queue: [“source”,{}]
    info: [debug] Responding to client with error: {“status”:13,“value”:{“message”:"
    An unknown server-side error occurred while processing the command.",“origValue”
    :“Tried to send command to non-existent Android socket, maybe it’s shutting down
    ?”},“sessionId”:“ea8cf1c0-d9a9-4dfa-bf18-fcef253ae765”}
    info: <-- GET /wd/hub/session/ea8cf1c0-d9a9-4dfa-bf18-fcef253ae765/source 500 3.
    246 ms - 248
    info: --> DELETE /wd/hub/session/ea8cf1c0-d9a9-4dfa-bf18-fcef253ae765 {}
    info: Shutting down appium session
    info: [debug] Pressing the HOME button
    info: [debug] executing: “E:\Automation\MobileAutomation\adt\adt-bundle\sdk\plat
    form-tools\adb.exe” -s 077c35ee0ade546b shell “input keyevent 3”
    info: [debug] Stopping logcat capture
    info: [debug] Logcat terminated with code null, signal SIGTERM
    info: [debug] Sent shutdown command, waiting for UiAutomator to stop…
    info: [debug] Didn’t get a new command in 60 secs, shutting down…
    info: Shutting down appium session
    info: [debug] Already in process of shutting down.
    info: [debug] Cleaning up appium session
    info: [debug] We shut down because no new commands came in

Following is the log for appium 4724 driver1:
info: [debug] executing: “E:\Automation\MobileAutomation\adt\adt-bundle\sdk\plat
form-tools\adb.exe” -s 077c35ee0ade546b shell “dumpsys window”
info: [debug] Writing dumpsys output to C:\Users\Raghuram\AppData\Roaming\npm\no
de_modules\appium.dumpsys.log
info: [debug] Screen already unlocked, continuing.
info: [debug] Pushing command to appium work queue: [“getDataDir”,{}]
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] [BOOTSTRAP] [debug] Returning result: {“value”:"/data/local/tmp
“,“status”:0}
info: [debug] dataDir set to: /data/local/tmp
info: [debug] Getting device API level
info: [debug] executing: “E:\Automation\MobileAutomation\adt\adt-bundle\sdk\plat
form-tools\adb.exe” -s 077c35ee0ade546b shell “getprop ro.build.version.sdk”
info: [debug] Device is at API Level 19
info: [debug] executing: “E:\Automation\MobileAutomation\adt\adt-bundle\sdk\plat
form-tools\adb.exe” -s 077c35ee0ade546b shell “am start -S -a android.intent.act
ion.MAIN -c android.intent.category.LAUNCHER -f 0x10200000 -n com.vcast.mediaman
ager/.gui.activities.SplashLogoActivity”
info: [debug] Waiting for pkg “com.vcast.mediamanager” and activity “.gui.activi
ties.SplashLogoActivity” to be focused
info: [debug] Getting focused package and activity
info: [debug] executing: “E:\Automation\MobileAutomation\adt\adt-bundle\sdk\plat
form-tools\adb.exe” -s 077c35ee0ade546b shell “dumpsys window windows”
info: [debug] Device launched! Ready for commands
info: [debug] Setting command timeout to the default of 60 secs
info: [debug] Appium session started with sessionId e60d3023-50c8-4084-be78-10d5
4e34a906
info: <-- POST /wd/hub/session 303 3902.020 ms - 9
info: --> GET /wd/hub/session/e60d3023-50c8-4084-be78-10d54e34a906 {}
info: [debug] Responding to client with success: {“status”:0,“value”:{“platform”
:“LINUX”,“browserName”:“Android”,“platformVersion”:“4.4.2”,“webStorageEnabled”:f
alse,“takesScreenshot”:true,“javascriptEnabled”:true,“databaseEnabled”:false,“ne
tworkConnectionEnabled”:true,“locationContextEnabled”:false,“warnings”:{},“desir
ed”:{“appPackage”:“com.vcast.mediamanager”,“appActivity”:”.gui.activities.Splash
LogoActivity",“platformVersion”:“4.4.2”,“platformName”:“Android”,“deviceName”:“N
exus5”},“appPackage”:“com.vcast.mediamanager”,“appActivity”:".gui.activities.Spl
ashLogoActivity",“platformName”:“Android”,“deviceName”:“Nexus5”},“sessionId”:“e6
0d3023-50c8-4084-be78-10d54e34a906”}
info: <-- GET /wd/hub/session/e60d3023-50c8-4084-be78-10d54e34a906 200 5.769 ms

  • 627 {“status”:0,“value”:{“platform”:“LINUX”,“browserName”:“Android”,“platformV
    ersion”:“4.4.2”,“webStorageEnabled”:false,“takesScreenshot”:true,“javascriptEnab
    led”:true,“databaseEnabled”:false,“networkConnectionEnabled”:true,“locationConte
    xtEnabled”:false,“warnings”:{},“desired”:{“appPackage”:“com.vcast.mediamanager”,
    “appActivity”:".gui.activities.SplashLogoActivity",“platformVersion”:“4.4.2”,“pl
    atformName”:“Android”,“deviceName”:“Nexus5”},“appPackage”:“com.vcast.mediamanage
    r”,“appActivity”:".gui.activities.SplashLogoActivity",“platformName”:“Android”,"
    deviceName":“Nexus5”},“sessionId”:“e60d3023-50c8-4084-be78-10d54e34a906”}
    info: [debug] UiAutomator exited
    info: [debug] executing: “E:\Automation\MobileAutomation\adt\adt-bundle\sdk\plat
    form-tools\adb.exe” -s 077c35ee0ade546b 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 Chromedriver
    error: Unhandled error: TypeError: Object function () { [native code] } has no m
    ethod ‘stop’
    at androidHybrid.cleanupChromedriver (C:\Users\Raghuram\AppData\Roaming\npm
    node_modules\appium\lib\devices\android\android-hybrid.js:198:18)
    at null. (C:\Users\Raghuram\AppData\Roaming\npm\node_modules\appi
    um\lib\devices\android\android.js:186:10)
    at null. (C:\Users\Raghuram\AppData\Roaming\npm\node_modules\appi
    um\lib\devices\android\android.js:208:9)
    at androidCommon.uninstallApp (C:\Users\Raghuram\AppData\Roaming\npm\node_mo
    dules\appium\lib\devices\android\android-common.js:465:5)
    at null. (C:\Users\Raghuram\AppData\Roaming\npm\node_modules\appi
    um\lib\devices\android\android.js:206:12)
    at null. (C:\Users\Raghuram\AppData\Roaming\npm\node_modules\appi
    um\lib\devices\android\android.js:215:11)
    at C:\Users\Raghuram\AppData\Roaming\npm\node_modules\appium\node_modules\ap
    pium-adb\lib\adb.js:902:7
    at null. (C:\Users\Raghuram\AppData\Roaming\npm\node_modules\appi
    um\node_modules\appium-adb\lib\adb.js:173:9)
    at ChildProcess.exithandler (child_process.js:646:7)
    at ChildProcess.emit (events.js:98:17) context: [POST /wd/hub/session {“desi
    redCapabilities”:{“appPackage”:“com.vcast.mediamanager”,“appActivity”:".gui.acti
    vities.SplashLogoActivity",“platformVersion”:“4.4.2”,“platformName”:“Android”,“d
    eviceName”:“Nexus5”}}]
    info: --> POST /wd/hub/session {“desiredCapabilities”:{“appPackage”:“com.vcast.m
    ediamanager”,“appActivity”:".gui.activities.SplashLogoActivity",“platformVersion
    “:“4.4.2”,“platformName”:“Android”,“deviceName”:“Nexus5”}}
    error: Failed to start an Appium session, err was: Error: Requested a new sessio
    n but one was in progress
    info: [debug] Error: Requested a new session but one was in progress
    at Appium.start (C:\Users\Raghuram\AppData\Roaming\npm\node_modules\appium\l
    ib\appium.js:115:15)
    at Object.exports.createSession [as handle] (C:\Users\Raghuram\AppData\Roami
    ng\npm\node_modules\appium\lib\server\controller.js:159:16)
    at next_layer (C:\Users\Raghuram\AppData\Roaming\npm\node_modules\appium\nod
    e_modules\express\lib\router\route.js:113:13)
    at Route.dispatch (C:\Users\Raghuram\AppData\Roaming\npm\node_modules\appium
    \node_modules\express\lib\router\route.js:117:5)
    at C:\Users\Raghuram\AppData\Roaming\npm\node_modules\appium\node_modules\ex
    press\lib\router\index.js:222:24
    at Function.proto.process_params (C:\Users\Raghuram\AppData\Roaming\npm\node
    _modules\appium\node_modules\express\lib\router\index.js:288:12)
    at next (C:\Users\Raghuram\AppData\Roaming\npm\node_modules\appium\node_modu
    les\express\lib\router\index.js:216:19)
    at next (C:\Users\Raghuram\AppData\Roaming\npm\node_modules\appium\node_modu
    les\express\lib\router\index.js:180:38)
    at next (C:\Users\Raghuram\AppData\Roaming\npm\node_modules\appium\node_modu
    les\express\lib\router\index.js:180:38)
    at next (C:\Users\Raghuram\AppData\Roaming\npm\node_modules\appium\node_modu
    les\express\lib\router\index.js:180:38)
    info: [debug] Responding to client with error: {“status”:33,“value”:{“message”:”
    A new session could not be created. (Original error: Requested a new session but
    one was in progress)”,“origValue”:“Requested a new session but one was in progr
    ess”},“sessionId”:“e60d3023-50c8-4084-be78-10d54e34a906”}
    info: <-- POST /wd/hub/session 500 4.452 ms - 250
    info: [debug] Didn’t get a new command in 60 secs, shutting down…
    info: Shutting down appium session
    info: [debug] Pressing the HOME button
    info: [debug] executing: “E:\Automation\MobileAutomation\adt\adt-bundle\sdk\plat
    form-tools\adb.exe” -s 077c35ee0ade546b shell “input keyevent 3”
    info: [debug] Stopping logcat capture
    info: [debug] Logcat terminated with code null, signal SIGTERM
    info: [debug] Sent shutdown command, waiting for UiAutomator to stop…
    ^CTerminate batch job (Y/N)? y

C:\Users\Raghuram>appium --port 4724
info: Welcome to Appium v1.2.2 (REV cf6ff5939ddc6b4d45fcbabfbfe13c950e0058c4)
info: Appium REST http interface listener started on 0.0.0.0:4724
info: [debug] Non-default server args: {“port”:4724}
info: LogLevel: debug
info: --> POST /wd/hub/session {“desiredCapabilities”:{“appPackage”:“com.vcast.m
ediamanager”,“appActivity”:".gui.activities.SplashLogoActivity","platformVersion
":“4.4.2”,“platformName”:“Android”,“deviceName”:“Nexus5”}}
info: [debug] Didn’t get app but did get Android package, will attempt to launch
it on the device
info: [debug] Creating new appium session c83505c2-d4ac-4a38-9c76-5d3b85cf7f48
info: Starting android appium
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 alr
eady on the device
info: [debug] Checking whether adb is present
info: [debug] Using adb from E:\Automation\MobileAutomation\adt\adt-bundle\sdk\p
latform-tools\adb.exe

info: Retrieving device
info: [debug] Trying to find a connected android device
info: [debug] Getting connected devices…
info: [debug] executing: “E:\Automation\MobileAutomation\adt\adt-bundle\sdk\plat
form-tools\adb.exe” devices
info: [debug] 2 device(s) connected
info: Found device 077c35ee0ade546b
info: [debug] Setting device id to 077c35ee0ade546b
info: [debug] Waiting for device to be ready and to respond to shell commands (t
imeout = 5)
info: [debug] executing: “E:\Automation\MobileAutomation\adt\adt-bundle\sdk\plat
form-tools\adb.exe” -s 077c35ee0ade546b wait-for-device
info: [debug] executing: “E:\Automation\MobileAutomation\adt\adt-bundle\sdk\plat
form-tools\adb.exe” -s 077c35ee0ade546b shell “echo ‘ready’”
info: [debug] Starting logcat capture
warn: No app capability, can’t parse package/activity
info: [debug] Getting device API level
info: [debug] executing: “E:\Automation\MobileAutomation\adt\adt-bundle\sdk\plat
form-tools\adb.exe” -s 077c35ee0ade546b shell “getprop ro.build.version.sdk”
info: [debug] Device is at API Level 19
info: Device API level is: 19
info: [debug] Apk doesn’t exist locally
info: [debug] executing: “E:\Automation\MobileAutomation\adt\adt-bundle\sdk\plat
form-tools\adb.exe” -s 077c35ee0ade546b shell “rm -rf /data/local/tmp/strings.js
on”
info: [debug] Not uninstalling app since server not started with --full-reset
info: [debug] Skipping install since we launched with a package instead of an ap
p path
info: [debug] Forwarding system:4724 to device:4724
info: [debug] executing: “E:\Automation\MobileAutomation\adt\adt-bundle\sdk\plat
form-tools\adb.exe” -s 077c35ee0ade546b forward tcp:4724 tcp:4724
info: [debug] Pushing appium bootstrap to device…
info: [debug] executing: “E:\Automation\MobileAutomation\adt\adt-bundle\sdk\plat
form-tools\adb.exe” -s 077c35ee0ade546b push “C:\Users\Raghuram\AppData\Roam
ing\npm\node_modules\appium\build\android_bootstrap\AppiumBootstrap.jar” /
data/local/tmp/
info: [debug] Pushing settings apk to device…
info: [debug] executing: “E:\Automation\MobileAutomation\adt\adt-bundle\sdk\plat
form-tools\adb.exe” -s 077c35ee0ade546b install “C:\Users\Raghuram\AppData\Roami
ng\npm\node_modules\appium\build\settings_apk\settings_apk-debug.apk”
info: [debug] Pushing unlock helper app to device…
info: [debug] executing: “E:\Automation\MobileAutomation\adt\adt-bundle\sdk\plat
form-tools\adb.exe” -s 077c35ee0ade546b install “C:\Users\Raghuram\AppData\Roami
ng\npm\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: “E:\Automation\MobileAutomation\adt\adt-bundle\sdk\plat
form-tools\adb.exe” -s 077c35ee0ade546b shell “ps ‘uiautomator’”
info: [debug] Attempting to kill process 4300
info: [debug] executing: “E:\Automation\MobileAutomation\adt\adt-bundle\sdk\plat
form-tools\adb.exe” -s 077c35ee0ade546b shell “kill 4300”
info: [debug] Running bootstrap
info: [debug] spawning: E:\Automation\MobileAutomation\adt\adt-bundle\sdk\platfo
rm-tools\adb.exe -s 077c35ee0ade546b shell uiautomator runtest AppiumBootstrap.j
ar -c io.appium.android.bootstrap.Bootstrap
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=UiAutomatorTestRun
ner
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: test=testRunServer
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: class=io.appium.andro
id.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] Waking up device if it’s not alive
info: [debug] Pushing command to appium work queue: [“wake”,{}]
info: [debug] [BOOTSTRAP] [debug] Registered crash watchers.
info: [debug] [BOOTSTRAP] [debug] Client connected
info: [debug] [BOOTSTRAP] [debug] Got data from client: {“cmd”:“action”,“action”
:“wake”,“params”:{}}
info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
info: [debug] [BOOTSTRAP] [debug] Got command action: wake
info: [debug] [BOOTSTRAP] [debug] Returning result: {“value”:true,“status”:0}
info: [debug] executing: “E:\Automation\MobileAutomation\adt\adt-bundle\sdk\plat
form-tools\adb.exe” -s 077c35ee0ade546b shell “dumpsys window”
info: [debug] Writing dumpsys output to C:\Users\Raghuram\AppData\Roaming\npm\no
de_modules\appium.dumpsys.log
info: [debug] Screen already unlocked, continuing.
info: [debug] Pushing command to appium work queue: [“getDataDir”,{}]
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] [BOOTSTRAP] [debug] Returning result: {“value”:"/data/local/tmp
“,“status”:0}
info: [debug] dataDir set to: /data/local/tmp
info: [debug] Getting device API level
info: [debug] executing: “E:\Automation\MobileAutomation\adt\adt-bundle\sdk\plat
form-tools\adb.exe” -s 077c35ee0ade546b shell “getprop ro.build.version.sdk”
info: [debug] Device is at API Level 19
info: [debug] executing: “E:\Automation\MobileAutomation\adt\adt-bundle\sdk\plat
form-tools\adb.exe” -s 077c35ee0ade546b shell “am start -S -a android.intent.act
ion.MAIN -c android.intent.category.LAUNCHER -f 0x10200000 -n com.vcast.mediaman
ager/.gui.activities.SplashLogoActivity”
info: [debug] Waiting for pkg “com.vcast.mediamanager” and activity “.gui.activi
ties.SplashLogoActivity” to be focused
info: [debug] Getting focused package and activity
info: [debug] executing: “E:\Automation\MobileAutomation\adt\adt-bundle\sdk\plat
form-tools\adb.exe” -s 077c35ee0ade546b shell “dumpsys window windows”
info: [debug] Device launched! Ready for commands
info: [debug] Setting command timeout to the default of 60 secs
info: [debug] Appium session started with sessionId c83505c2-d4ac-4a38-9c76-5d3b
85cf7f48
info: <-- POST /wd/hub/session 303 4047.754 ms - 9
info: --> GET /wd/hub/session/c83505c2-d4ac-4a38-9c76-5d3b85cf7f48 {}
info: [debug] Responding to client with success: {“status”:0,“value”:{“platform”
:“LINUX”,“browserName”:“Android”,“platformVersion”:“4.4.2”,“webStorageEnabled”:f
alse,“takesScreenshot”:true,“javascriptEnabled”:true,“databaseEnabled”:false,“ne
tworkConnectionEnabled”:true,“locationContextEnabled”:false,“warnings”:{},“desir
ed”:{“appPackage”:“com.vcast.mediamanager”,“appActivity”:”.gui.activities.Splash
LogoActivity",“platformVersion”:“4.4.2”,“platformName”:“Android”,“deviceName”:“N
exus5”},“appPackage”:“com.vcast.mediamanager”,“appActivity”:".gui.activities.Spl
ashLogoActivity",“platformName”:“Android”,“deviceName”:“Nexus5”},“sessionId”:“c8
3505c2-d4ac-4a38-9c76-5d3b85cf7f48”}
info: <-- GET /wd/hub/session/c83505c2-d4ac-4a38-9c76-5d3b85cf7f48 200 6.061 ms

  • 627 {“status”:0,“value”:{“platform”:“LINUX”,“browserName”:“Android”,“platformV
    ersion”:“4.4.2”,“webStorageEnabled”:false,“takesScreenshot”:true,“javascriptEnab
    led”:true,“databaseEnabled”:false,“networkConnectionEnabled”:true,“locationConte
    xtEnabled”:false,“warnings”:{},“desired”:{“appPackage”:“com.vcast.mediamanager”,
    “appActivity”:".gui.activities.SplashLogoActivity",“platformVersion”:“4.4.2”,“pl
    atformName”:“Android”,“deviceName”:“Nexus5”},“appPackage”:“com.vcast.mediamanage
    r”,“appActivity”:".gui.activities.SplashLogoActivity",“platformName”:“Android”,"
    deviceName":“Nexus5”},“sessionId”:“c83505c2-d4ac-4a38-9c76-5d3b85cf7f48”}
    info: [debug] Didn’t get a new command in 60 secs, shutting down…
    info: Shutting down appium session
    info: [debug] Pressing the HOME button
    info: [debug] executing: “E:\Automation\MobileAutomation\adt\adt-bundle\sdk\plat
    form-tools\adb.exe” -s 077c35ee0ade546b shell “input keyevent 3”
    info: [debug] Stopping logcat capture
    info: [debug] Logcat terminated with code null, signal SIGTERM
    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: {“value”:“OK, shutting down”
    ,“status”:0}
    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=UiAutomatorTestRun
    ner
    info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: test=testRunServer
    info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: class=io.appium.andro
    id.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: 62.058
    info: [debug] [UIAUTOMATOR STDOUT] OK (1 test)
    info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS_CODE: -1
    info: [debug] Sent shutdown command, waiting for UiAutomator to stop…
    info: [debug] UiAutomator shut down normally
    info: [debug] Cleaning up android objects
    info: [debug] Cleaning up appium session
    info: [debug] We shut down because no new commands came in

Try to set the udid as a capability, one for each device and when you wake up each appium server add --udid {thePhoneID}, It’s works for me.

1 Like

Thanks,now able to automate multiple android devices

1 Like

Nice :slight_smile: !! Have fun !

Hi

I tried with the below code to launch app in 2 devices using appium but a message was displayed as"Could not start a new session". Please find the log and code

public void SetUp() throws Exception {
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(“automationName”, “Appium”);
capabilities.setCapability(“platform”, “Windows”);
capabilities.setCapability(“platformName”, “Android”);
capabilities.setCapability(“deviceName”, “Android”);
capabilities.setCapability(“udid”,“emulator-5555”);
capabilities.setCapability(CapabilityType.VERSION, “4.4.4”);
capabilities.setCapability(“appPackage”, “**");
capabilities.setCapability(“appActivity”, "
”);
capabilities.setCapability(“app”,“C://Users/supv0001/Downloads/debug-prod.apk” );
driver = new AppiumDriver(new URL(“http://127.0.0.1:4723/wd/hub”),capabilities);
Reporter.log(“App1 launched”, true);

    DesiredCapabilities capabilities1 = new DesiredCapabilities();
    capabilities1.setCapability("automationName", "Appium");
    capabilities.setCapability("platform", "Windows");
     capabilities1.setCapability("platformName", "Android");
     capabilities1.setCapability("deviceName", "Android");
     capabilities.setCapability("udid","emulator-5556");
     capabilities.setCapability(CapabilityType.VERSION, "4.4.4");
    capabilities1.setCapability("appPackage", "********");
    capabilities1.setCapability("appActivity", "************");
    capabilities1.setCapability("app","C://Users/supv0001/Downloads/debug-prod.apk" );
    driver1 = new AppiumDriver(new URL("http://127.0.0.1:4724/wd/hub"),capabilities);
    Reporter.log("App2 launched", true);
    
    driver.manage().timeouts().implicitlyWait(timeOut, TimeUnit.SECONDS);
    Thread.sleep(50000);
    System.out.println("Port launched");
}

Starting Node Server
info: [debug] Starting Appium in pre-launch mode
info: Pre-launching app
info: [debug] No appActivity desired capability or server param. Parsing from apk.
info: [debug] Using local app from command line: C:\Users\supv0001\Downloads\debug-prod.apk
info: [debug] Creating new appium session 19d26482-1175-4651-b0d4-df485f189d68
info: Starting android appium
info: [debug] Using fast reset? false
info: [debug] Preparing device for session
info: [debug] Checking whether app is actually present
info: [debug] Checking whether adb is present
info: [debug] Using adb from C:\Users\supv0001\Downloads\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe
info: Retrieving device
info: [debug] Trying to find a connected android device
info: [debug] Getting connected devices…
info: [debug] executing: “C:\Users\supv0001\Downloads\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe” devices
info: [debug] 2 device(s) connected
info: Found device 192.168.56.102:5555
info: [debug] Setting device id to 192.168.56.102:5555
info: [debug] Waiting for device to be ready and to respond to shell commands (timeout = 5)
info: [debug] executing: “C:\Users\supv0001\Downloads\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe” -s 192.168.56.102:5555 wait-for-device
info: [debug] executing: “C:\Users\supv0001\Downloads\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe” -s 192.168.56.102:5555 shell “echo ‘ready’”
info: [debug] Starting logcat capture
info: [debug] Parsing package and activity from app manifest
info: [debug] Checking whether aapt is present
info: [debug] Using aapt from C:\Users\supv0001\Downloads\adt-bundle-windows-x86_64-20140702\sdk\build-tools\android-4.4W\aapt.exe
info: [debug] packageAndLaunchActivityFromManifest: “C:\Users\supv0001\Downloads\adt-bundle-windows-x86_64-20140702\sdk\build-tools\android-4.4W\aapt.exe” dump badging “C:\Users\supv0001\Downloads\mct-att-14.3.13-debug-prod.apk”
info: [debug] badging package: **********
info: [debug] badging act: SplashActivity
info: [debug] Parsed package and activity are: ********SplashActivity
info: [debug] Getting device API level
info: [debug] executing: “C:\Users\supv0001\Downloads\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe” -s 192.168.56.102:5555 shell “getprop ro.build.version.sdk”
info: [debug] Device is at API Level 19
info: Device API level is: 19
info: [debug] executing: “C:\Users\supv0001\Downloads\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe” -s 192.168.56.102:5555 shell “getprop persist.sys.language”
info: [debug] Current device language:
info: [debug] java -jar “C:\Users\supv0001\Downloads\Appium\node_modules\appium\node_modules\appium-adb\jars\appium_apk_tools.jar” “stringsFromApk” “C:\Users\supv0001\Downloads\mct-att-14.3.13-debug-prod.apk” "C:\Windows\Temp*
"
info: [debug] executing: “C:\Users\supv0001\Downloads\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe” -s 192.168.56.102:5555 push "C:\Windows\Temp*
*******\strings.json" /data/local/tmp
info: [debug] Checking whether aapt is present
info: [debug] Using aapt from C:\Users\supv0001\Downloads\adt-bundle-windows-x86_64-20140702\sdk\build-tools\android-4.4W\aapt.exe
info: [debug] processFromManifest: “C:\Users\supv0001\Downloads\adt-bundle-windows-x86_64-20140702\sdk\build-tools\android-4.4W\aapt.exe” dump xmltree “C:\Users\supv0001\Downloads\debug-prod.apk” AndroidManifest.xml
info: [debug] Set app process to: **************
info: [debug] Uninstalling *********************
info: [debug] executing: “C:\Users\supv0001\Downloads\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe” -s 192.168.56.102:5555 shell “am force-stop ************"
info: [debug] executing: “C:\Users\supv0001\Downloads\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe” -s 192.168.56.102:5555 uninstall ****************
info: [debug] App was not uninstalled, maybe it wasn’t on device?
info: [debug] Checking app cert for C:\Users\supv0001\Downloads\debug-prod.apk: java -jar “C:\Users\supv0001\Downloads\Appium\node_modules\appium\node_modules\appium-adb\jars\verify.jar” “C:\Users\supv0001\Downloads\debug-prod.apk”
info: [debug] App already signed.
info: [debug] Zip-aligning C:\Users\supv0001\Downloads\debug-prod.apk
info: [debug] Checking whether zipalign is present
info: [debug] Using zipalign from C:\Users\supv0001\Downloads\adt-bundle-windows-x86_64-20140702\sdk\build-tools\android-4.4W\zipalign.exe
info: [debug] zipAlignApk: “C:\Users\supv0001\Downloads\adt-bundle-windows-x86_64-20140702\sdk\build-tools\android-4.4W\zipalign.exe” -f 4 “C:\Users\supv0001\Downloads\debug-prod.apk” “C:\Users\supv0001\AppData\Local\Temp\appium1141010-6576-1h48i63.tmp”
info: [debug] MD5 for app is bde21748ed34bce931cdaeb253caa9d8
info: [debug] executing: “C:\Users\supv0001\Downloads\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe” -s 192.168.56.102:5555 shell “ls /data/local/tmp/bde21748ed34bce931cdaeb253caa9d8.apk”
info: [debug] Getting install status for ***************
info: [debug] Getting device API level
info: [debug] executing: “C:\Users\supv0001\Downloads\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe” -s 192.168.56.102:5555 shell “getprop ro.build.version.sdk”
info: [debug] Device is at API Level 19
info: [debug] executing: “C:\Users\supv0001\Downloads\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe” -s 192.168.56.102:5555 shell “pm list packages -3 ************"
info: [debug] App is not installed
info: Installing App
info: [debug] executing: “C:\Users\supv0001\Downloads\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe” -s 192.168.56.102:5555 shell “mkdir -p /data/local/tmp/”
info: [debug] Removing any old apks
info: [debug] executing: “C:\Users\supv0001\Downloads\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe” -s 192.168.56.102:5555 shell "ls /data/local/tmp/
.apk”
info: [debug] Found an apk we want to keep at /data/local/tmp/bde21748ed34bce931cdaeb253caa9d8.apk
info: [debug] Couldn’t find any apks to remove
info: [debug] Uninstalling **************
info: [debug] executing: “C:\Users\supv0001\Downloads\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe” -s 192.168.56.102:5555 shell "am force-stop "
info: [debug] executing: “C:\Users\supv0001\Downloads\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe” -s 192.168.56.102:5555 uninstall ************
info: [debug] App was not uninstalled, maybe it wasn’t on device?
info: [debug] executing: “C:\Users\supv0001\Downloads\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe” -s 192.168.56.102:5555 shell “pm install -r /data/local/tmp/bde21748ed34bce931cdaeb253caa9d8.apk”
info: [debug] Forwarding system:4724 to device:4724
info: [debug] executing: “C:\Users\supv0001\Downloads\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe” -s 192.168.56.102:5555 forward tcp:4724 tcp:4724
info: [debug] Pushing appium bootstrap to device…
info: [debug] executing: “C:\Users\supv0001\Downloads\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe” -s 192.168.56.102:5555 push “C:\Users\supv0001\Downloads\Appium\node_modules\appium\build\android_bootstrap\AppiumBootstrap.jar” /data/local/tmp/
info: [debug] Pushing settings apk to device…
info: [debug] executing: “C:\Users\supv0001\Downloads\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe” -s 192.168.56.102:5555 install “C:\Users\supv0001\Downloads\Appium\node_modules\appium\build\settings_apk\settings_apk-debug.apk”
info: [debug] Pushing unlock helper app to device…
info: [debug] executing: “C:\Users\supv0001\Downloads\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe” -s 192.168.56.102:5555 install “C:\Users\supv0001\Downloads\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: “C:\Users\supv0001\Downloads\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe” -s 192.168.56.102:5555 shell “ps ‘uiautomator’”
info: [debug] No matching processes found
info: [debug] Running bootstrap
info: [debug] spawning: C:\Users\supv0001\Downloads\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe -s 192.168.56.102:5555 shell uiautomator runtest AppiumBootstrap.jar -c io.appium.android.bootstrap.Bootstrap
info: [debug] e[90m[UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: numtests=1e[39m
info: [debug] e[90m[UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: stream=e[39m
info: [debug] e[90m[UIAUTOMATOR STDOUT] io.appium.android.bootstrap.Bootstrap:e[39m
info: [debug] e[90m[UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: id=UiAutomatorTestRunnere[39m
info: [debug] e[90m[UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: test=testRunServere[39m
info: [debug] e[90m[UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: class=io.appium.android.bootstrap.Bootstrape[39m
info: [debug] e[90m[UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: current=1e[39m
info: [debug] e[90m[UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS_CODE: 1e[39m
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] Waking up device if it’s not alive
info: [debug] Pushing command to appium work queue: [“wake”,{}]
info: [debug] [BOOTSTRAP] [debug] json loading complete.
info: [debug] [BOOTSTRAP] [debug] Registered crash watchers.
info: [debug] [BOOTSTRAP] [debug] Client connected
info: [debug] [BOOTSTRAP] [debug] Got data from client: {“cmd”:“action”,“action”:“wake”,“params”:{}}
info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
info: [debug] [BOOTSTRAP] [debug] Got command action: wake
info: [debug] [BOOTSTRAP] [debug] Returning result: {“value”:true,“status”:0}
info: [debug] executing: “C:\Users\supv0001\Downloads\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe” -s 192.168.56.102:5555 shell “dumpsys window”
info: [debug] Writing dumpsys output to C:\Users\supv0001\Downloads\Appium\node_modules\appium.dumpsys.log
info: [debug] Screen already unlocked, continuing.
info: [debug] Pushing command to appium work queue: [“getDataDir”,{}]
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] [BOOTSTRAP] [debug] Returning result: {“value”:“/data”,“status”:0}
info: [debug] dataDir set to: /data
info: [debug] Pushing command to appium work queue: [“compressedLayoutHierarchy”,{“compressLayout”:false}]
info: [debug] [BOOTSTRAP] [debug] Got data from client: {“cmd”:“action”,“action”:“compressedLayoutHierarchy”,“params”:{“compressLayout”:false}}
info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
info: [debug] [BOOTSTRAP] [debug] Got command action: compressedLayoutHierarchy
info: [debug] Getting device API level
info: [debug] executing: “C:\Users\supv0001\Downloads\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe” -s 192.168.56.102:5555 shell “getprop ro.build.version.sdk”
info: [debug] [BOOTSTRAP] [debug] Returning result: {“value”:false,“status”:0}
info: [debug] Device is at API Level 19
info: [debug] executing: “C:\Users\supv0001\Downloads\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe” -s 192.168.56.102:5555 shell "am start -S -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -f 0x10200000 -n r/SplashActivity"
info: [debug] Waiting for pkg "
" and activity “SplashActivity” to be focused
info: [debug] Getting focused package and activity
info: [debug] executing: “C:\Users\supv0001\Downloads\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe” -s 192.168.56.102:5555 shell “dumpsys window windows”
info: [debug] Device launched! Ready for commands
info: [debug] Setting command timeout to the default of 60 secs
info: Welcome to Appium v1.2.4 (REV 71584425ecf777349e3215f0f18e71e7782acfb6)
info: Appium REST http interface listener started on 127.0.0.1:4723
info: [debug] Non-default server args: {“app”:“C:\Users\supv0001\Downloads\debug-prod.apk”,“address”:“127.0.0.1”,“sessionOverride”:true,“fullReset”:true,“launch”:true,“logNoColors”:true,“androidPackage”:"
”,“deviceName”:“GoogleNexus5”,“platformName”:“Android”,“platformVersion”:“19”,“automationName”:“Appium”}
info: Console LogLevel: debug
info: e[37m–>e[39m e[37mPOSTe[39m e[37m/wd/hub/sessione[39m e[90m{“desiredCapabilities”:{“appPackage”:“com.att.mobiletransfer”,“appActivity”:“SplashConnectingActivity”,“app”:“C://Users/supv0001/Downloads/ebug-prod.apk”,“automationName”:“Appium”,“platformName”:“Android”,“udid”:“emulator-5555”,“deviceName”:“Android”,“version”:“4.4.4”,“platform”:“Windows”}}e[39m
info: e[37m<-- POST /wd/hub/session e[39me[36m303e[39me[90m 2.987 ms - 9e[39m e[90me[39m
info: e[37m–>e[39m e[37mGETe[39m e[37m/wd/hub/session/19d26482-1175-4651-b0d4-df485f189d68e[39m e[90m{}e[39m
info: [debug] Responding to client with success: {“status”:0,“value”:{“platform”:“LINUX”,“browserName”:“Android”,“platformVersion”:“4.1”,“webStorageEnabled”:false,“takesScreenshot”:true,“javascriptEnabled”:true,“databaseEnabled”:false,“networkConnectionEnabled”:true,“locationContextEnabled”:false,“warnings”:{},“desired”:{}},“sessionId”:“19d26482-1175-4651-b0d4-df485f189d68”}
info: e[37m<-- GET /wd/hub/session/19d26482-1175-4651-b0d4-df485f189d68 e[39me[32m200e[39me[90m 1.630 ms - 328e[39m e[90m{“status”:0,“value”:{“platform”:“LINUX”,“browserName”:“Android”,“platformVersion”:“4.1”,“webStorageEnabled”:false,“takesScreenshot”:true,“javascriptEnabled”:true,“databaseEnabled”:false,“networkConnectionEnabled”:true,“locationContextEnabled”:false,“warnings”:{},“desired”:{}},“sessionId”:“19d26482-1175-4651-b0d4-df485f189d68”}e[39m
info: [debug] Didn’t get a new command in 60 secs, shutting down…
info: Shutting down appium session
info: [debug] Removing app from device
info: [debug] Uninstalling com.att.mobiletransfer
info: [debug] executing: “C:\Users\supv0001\Downloads\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe” -s 192.168.56.102:5555 shell “am force-stop ********”
info: [debug] executing: “C:\Users\supv0001\Downloads\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe” -s 192.168.56.102:5555 uninstall **************
info: [debug] App was uninstalled
info: [debug] Pressing the HOME button
info: [debug] executing: “C:\Users\supv0001\Downloads\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe” -s 192.168.56.102:5555 shell “input keyevent 3”
info: [debug] Stopping logcat capture
info: [debug] Logcat terminated with code null, signal SIGTERM
info: [debug] Sent shutdown command, waiting for UiAutomator to stop…
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: {“value”:“OK, shutting down”,“status”:0}
info: [debug] [BOOTSTRAP] [debug] Closed client connection
info: [debug] e[90m[UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: numtests=1e[39m
info: [debug] e[90m[UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: stream=.e[39m
info: [debug] e[90m[UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: id=UiAutomatorTestRunnere[39m
info: [debug] e[90m[UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: test=testRunServere[39m
info: [debug] e[90m[UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: class=io.appium.android.bootstrap.Bootstrape[39m
info: [debug] e[90m[UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: current=1e[39m
info: [debug] e[90m[UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS_CODE: 0e[39m
info: [debug] e[90m[UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: stream=e[39m
info: [debug] e[90m[UIAUTOMATOR STDOUT] Test results for WatcherResultPrinter=.e[39m
info: [debug] e[90m[UIAUTOMATOR STDOUT] Time: 74.907e[39m
info: [debug] e[90m[UIAUTOMATOR STDOUT] OK (1 test)e[39m
info: [debug] e[90m[UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS_CODE: -1e[39m
info: [debug] UiAutomator shut down normally
info: [debug] Cleaning up android objects
info: [debug] Cleaning up appium session
info: [debug] We shut down because no new commands came in

Kindly help me to find out where i am going wrong, i need to automate data transfer between 2 devices.