Run test on multiple device

I am trying to run test on two devices sequentially,
first case is working fine but the second case also it is running on the same device,
not identifying the other device

i am getting following error.

e[36minfoe[39m: [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. : takesScreenshot, app-package, app-activity, device
e[36minfoe[39m: [debug] No appActivity desired capability or server param. Parsing from apk.
e[36minfoe[39m: [debug] No appPackage desired capability or server param. Parsing from apk.
e[36minfoe[39m: [debug] Using local app from desired caps: C:\Users\Shivkumar roza\Apk\app-prod.apk
e[36minfoe[39m: [debug] Creating new appium session 5aa552a1-9884-4b7e-b0c8-4a08962ff998
e[36minfoe[39m: Starting android appium
e[36minfoe[39m: [debug] Getting Java version
e[36minfoe[39m: Java version is: 1.8.0_45
e[36minfoe[39m: [debug] Checking whether adb is present
e[36minfoe[39m: [debug] Using adb from C:\Android\android-sdk\platform-tools\adb.exe
e[36minfoe[39m: [debug] Parsing package and activity from app manifest
e[36minfoe[39m: [debug] Checking whether aapt is present
e[36minfoe[39m: [debug] Using aapt from C:\Android\android-sdk\build-tools\23.0.1\aapt.exe
e[36minfoe[39m: [debug] Extracting package and launch activity from manifest.
e[36minfoe[39m: [debug] executing cmd: C:\Android\android-sdk\build-tools\23.0.1\aapt.exe dump badging “C:\Users\Shivkumar roza\Apk\app-prod.apk”
e[36minfoe[39m: [debug] badging package: com.app.wooplr
e[36minfoe[39m: [debug] badging act: com.app.wooplr.activities.SplashActivity
e[36minfoe[39m: [debug] Parsed package and activity are: com.app.wooplr/com.app.wooplr.activities.SplashActivity
e[36minfoe[39m: [debug] Using fast reset? true
e[36minfoe[39m: [debug] Preparing device for session
e[36minfoe[39m: [debug] Checking whether app is actually present
e[36minfoe[39m: Retrieving device
e[36minfoe[39m: [debug] Trying to find a connected android device
e[36minfoe[39m: [debug] Getting connected devices…
e[36minfoe[39m: [debug] executing cmd: C:\Android\android-sdk\platform-tools\adb.exe devices
e[36minfoe[39m: [debug] 2 device(s) connected
e[36minfoe[39m: Found device 192.168.1.139:5555
e[36minfoe[39m: [debug] Setting device id to 192.168.1.139:5555
e[36minfoe[39m: [debug] Waiting for device to be ready and to respond to shell commands (timeout = 5)
e[36minfoe[39m: [debug] executing cmd: C:\Android\android-sdk\platform-tools\adb.exe -s 192.168.1.139:5555 wait-for-device
e[36minfoe[39m: [debug] executing cmd: C:\Android\android-sdk\platform-tools\adb.exe -s 192.168.1.139:5555 shell “echo ‘ready’”
e[36minfoe[39m: [debug] Starting logcat capture
e[36minfoe[39m: [debug] Getting device API level
e[36minfoe[39m: [debug] executing cmd: C:\Android\android-sdk\platform-tools\adb.exe -s 192.168.1.139:5555 shell “getprop ro.build.version.sdk”
e[36minfoe[39m: [debug] Device is at API Level 19
e[36minfoe[39m: Device API level is: 19
e[36minfoe[39m: [debug] Extracting strings for language: default
e[36minfoe[39m: [debug] executing cmd: C:\Android\android-sdk\platform-tools\adb.exe -s 192.168.1.139:5555 shell “getprop persist.sys.language”
e[36minfoe[39m: [debug] Current device persist.sys.language: en
e[36minfoe[39m: [debug] java -jar “C:\Program Files (x86)\Appium\node_modules\appium\node_modules\appium-adb\jars\appium_apk_tools.jar” “stringsFromApk” “C:\Users\Shivkumar roza\Apk\app-prod.apk” “C:\Users\SHIVKU~1\AppData\Local\Temp\com.app.wooplr” en
e[36minfoe[39m: [debug] No strings.xml for language ‘en’, getting default strings.xml
e[36minfoe[39m: [debug] java -jar “C:\Program Files (x86)\Appium\node_modules\appium\node_modules\appium-adb\jars\appium_apk_tools.jar” “stringsFromApk” “C:\Users\Shivkumar roza\Apk\app-prod.apk” “C:\Users\SHIVKU~1\AppData\Local\Temp\com.app.wooplr”
e[36minfoe[39m: [debug] Reading strings from converted strings.json
e[36minfoe[39m: [debug] Setting language to default
e[36minfoe[39m: [debug] executing cmd: C:\Android\android-sdk\platform-tools\adb.exe -s 192.168.1.139:5555 push “C:\Users\SHIVKU~1\AppData\Local\Temp\com.app.wooplr\strings.json” /data/local/tmp
e[36minfoe[39m: [debug] Checking whether aapt is present
e[36minfoe[39m: [debug] Using aapt from C:\Android\android-sdk\build-tools\23.0.1\aapt.exe
e[36minfoe[39m: [debug] Retrieving process from manifest.
e[36minfoe[39m: [debug] executing cmd: C:\Android\android-sdk\build-tools\23.0.1\aapt.exe dump xmltree “C:\Users\Shivkumar roza\Apk\app-prod.apk” AndroidManifest.xml
e[36minfoe[39m: [debug] Set app process to: com.app.wooplr
e[36minfoe[39m: [debug] Not uninstalling app since server not started with --full-reset
e[36minfoe[39m: [debug] Checking app cert for C:\Users\Shivkumar roza\Apk\app-prod.apk.
e[36minfoe[39m: [debug] executing cmd: java -jar “C:\Program Files (x86)\Appium\node_modules\appium\node_modules\appium-adb\jars\verify.jar” “C:\Users\Shivkumar roza\Apk\app-prod.apk”
e[36minfoe[39m: [debug] App already signed.
e[36minfoe[39m: [debug] Zip-aligning C:\Users\Shivkumar roza\Apk\app-prod.apk
e[36minfoe[39m: [debug] Checking whether zipalign is present
e[36minfoe[39m: [debug] Using zipalign from C:\Android\android-sdk\build-tools\23.0.1\zipalign.exe
e[36minfoe[39m: [debug] Zip-aligning apk.
e[36minfoe[39m: [debug] executing cmd: C:\Android\android-sdk\build-tools\23.0.1\zipalign.exe -f 4 “C:\Users\Shivkumar roza\Apk\app-prod.apk” C:\Users\SHIVKU~1\AppData\Local\Temp\1151018-8528-yqf8mp\appium.tmp
e[36minfoe[39m: [debug] MD5 for app is fb3381fd4f75ee52d25f9be47ef694ef
e[36minfoe[39m: [debug] executing cmd: C:\Android\android-sdk\platform-tools\adb.exe -s 192.168.1.139:5555 shell “ls /data/local/tmp/fb3381fd4f75ee52d25f9be47ef694ef.apk”
e[36minfoe[39m: [debug] Getting install status for com.app.wooplr
e[36minfoe[39m: [debug] Getting device API level
e[36minfoe[39m: [debug] executing cmd: C:\Android\android-sdk\platform-tools\adb.exe -s 192.168.1.139:5555 shell “getprop ro.build.version.sdk”
e[36minfoe[39m: [debug] Device is at API Level 19
e[36minfoe[39m: [debug] executing cmd: C:\Android\android-sdk\platform-tools\adb.exe -s 192.168.1.139:5555 shell “pm list packages -3 com.app.wooplr”
e[36minfoe[39m: [debug] App is installed
e[36minfoe[39m: App is already installed, resetting app
e[36minfoe[39m: [debug] Running fast reset (stop and clear)
e[36minfoe[39m: [debug] executing cmd: C:\Android\android-sdk\platform-tools\adb.exe -s 192.168.1.139:5555 shell “am force-stop com.app.wooplr”
e[36minfoe[39m: [debug] executing cmd: C:\Android\android-sdk\platform-tools\adb.exe -s 192.168.1.139:5555 shell “pm clear com.app.wooplr”
e[36minfoe[39m: [debug] Forwarding system:4724 to device:4724
e[36minfoe[39m: [debug] executing cmd: C:\Android\android-sdk\platform-tools\adb.exe -s 192.168.1.139:5555 forward tcp:4724 tcp:4724
e[36minfoe[39m: [debug] Pushing appium bootstrap to device…
e[36minfoe[39m: [debug] executing cmd: C:\Android\android-sdk\platform-tools\adb.exe -s 192.168.1.139:5555 push “C:\Program Files (x86)\Appium\node_modules\appium\build\android_bootstrap\AppiumBootstrap.jar” /data/local/tmp/
e[36minfoe[39m: [debug] Pushing settings apk to device…
e[36minfoe[39m: [debug] executing cmd: C:\Android\android-sdk\platform-tools\adb.exe -s 192.168.1.139:5555 install “C:\Program Files (x86)\Appium\node_modules\appium\build\settings_apk\settings_apk-debug.apk”
e[36minfoe[39m: [debug] Pushing unlock helper app to device…
e[36minfoe[39m: [debug] executing cmd: C:\Android\android-sdk\platform-tools\adb.exe -s 192.168.1.139:5555 install “C:\Program Files (x86)\Appium\node_modules\appium\build\unlock_apk\unlock_apk-debug.apk”
e[36minfoe[39m: Starting App
e[36minfoe[39m: [debug] Attempting to kill all ‘uiautomator’ processes
e[36minfoe[39m: [debug] Getting all processes with ‘uiautomator’
e[36minfoe[39m: [debug] executing cmd: C:\Android\android-sdk\platform-tools\adb.exe -s 192.168.1.139:5555 shell “ps ‘uiautomator’”
e[36minfoe[39m: [debug] No matching processes found
e[36minfoe[39m: [debug] Running bootstrap
e[36minfoe[39m: [debug] spawning: C:\Android\android-sdk\platform-tools\adb.exe -s 192.168.1.139:5555 shell uiautomator runtest AppiumBootstrap.jar -c io.appium.android.bootstrap.Bootstrap -e pkg com.app.wooplr -e disableAndroidWatchers false
e[36minfoe[39m: [debug] e[90m[UIAUTOMATOR STDOUT] opene[39m
e[36minfoe[39m: [debug] e[90m[UIAUTOMATOR STDOUT] : Permission deniede[39m
e[36minfoe[39m: [debug] e[90m[UIAUTOMATOR STDOUT] open: Permission deniede[39m
e[36minfoe[39m: [debug] e[90m[UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: numtests=1e[39m
e[36minfoe[39m: [debug] e[90m[UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: stream=e[39m
e[36minfoe[39m: [debug] e[90m[UIAUTOMATOR STDOUT] io.appium.android.bootstrap.Bootstrap:e[39m
e[36minfoe[39m: [debug] e[90m[UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: id=UiAutomatorTestRunnere[39m
e[36minfoe[39m: [debug] e[90m[UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: test=testRunServere[39m
e[36minfoe[39m: [debug] e[90m[UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: class=io.appium.android.bootstrap.Bootstrape[39m
e[36minfoe[39m: [debug] e[90m[UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: current=1e[39m
e[36minfoe[39m: [debug] e[90m[UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS_CODE: 1e[39m
e[36minfoe[39m: [debug] [BOOTSTRAP] [debug] Socket opened on port 4724
e[36minfoe[39m: [debug] [BOOTSTRAP] [debug] Appium Socket Server Ready
e[36minfoe[39m: [debug] [BOOTSTRAP] [debug] Loading json…
e[36minfoe[39m: [debug] Waking up device if it’s not alive
e[36minfoe[39m: [debug] Pushing command to appium work queue: [“wake”,{}]
e[36minfoe[39m: [debug] [BOOTSTRAP] [debug] json loading complete.
e[36minfoe[39m: [debug] [BOOTSTRAP] [debug] Registered crash watchers.
e[36minfoe[39m: [debug] [BOOTSTRAP] [debug] Client connected
e[36minfoe[39m: [debug] [BOOTSTRAP] [debug] Got data from client: {“cmd”:“action”,“action”:“wake”,“params”:{}}
e[36minfoe[39m: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
e[36minfoe[39m: [debug] [BOOTSTRAP] [debug] Got command action: wake
e[36minfoe[39m: [debug] executing cmd: C:\Android\android-sdk\platform-tools\adb.exe -s 192.168.1.139:5555 shell “dumpsys window”
e[36minfoe[39m: [debug] [BOOTSTRAP] [debug] Returning result: {“value”:true,“status”:0}
e[36minfoe[39m: [debug] Screen already unlocked, continuing.
e[36minfoe[39m: [debug] Pushing command to appium work queue: [“getDataDir”,{}]
e[36minfoe[39m: [debug] [BOOTSTRAP] [debug] Got data from client: {“cmd”:“action”,“action”:“getDataDir”,“params”:{}}
e[36minfoe[39m: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
e[36minfoe[39m: [debug] [BOOTSTRAP] [debug] Got command action: getDataDir
e[36minfoe[39m: [debug] [BOOTSTRAP] [debug] Returning result: {“value”:"/data/local/tmp",“status”:0}
e[36minfoe[39m: [debug] dataDir set to: /data/local/tmp
e[36minfoe[39m: [debug] Pushing command to appium work queue: [“compressedLayoutHierarchy”,{“compressLayout”:false}]
e[36minfoe[39m: [debug] [BOOTSTRAP] [debug] Got data from client: {“cmd”:“action”,“action”:“compressedLayoutHierarchy”,“params”:{“compressLayout”:false}}
e[36minfoe[39m: [debug] Getting device API level
e[36minfoe[39m: [debug] executing cmd: C:\Android\android-sdk\platform-tools\adb.exe -s 192.168.1.139:5555 shell “getprop ro.build.version.sdk”
e[36minfoe[39m: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
e[36minfoe[39m: [debug] [BOOTSTRAP] [debug] Got command action: compressedLayoutHierarchy
e[36minfoe[39m: [debug] [BOOTSTRAP] [debug] Returning result: {“value”:false,“status”:0}
e[36minfoe[39m: [debug] Device is at API Level 19
e[36minfoe[39m: [debug] executing cmd: C:\Android\android-sdk\platform-tools\adb.exe -s 192.168.1.139:5555 shell “am start -S -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -f 0x10200000 -n com.app.wooplr/com.app.wooplr.activities.SplashActivity”
e[36minfoe[39m: [debug] Waiting for pkg “com.app.wooplr” and activity “com.app.wooplr.activities.SplashActivity” to be focused
e[36minfoe[39m: [debug] Getting focused package and activity
e[36minfoe[39m: [debug] executing cmd: C:\Android\android-sdk\platform-tools\adb.exe -s 192.168.1.139:5555 shell “dumpsys window windows”
e[36minfoe[39m: [debug] executing cmd: C:\Android\android-sdk\platform-tools\adb.exe -s 192.168.1.139:5555 shell “getprop ro.build.version.release”
e[36minfoe[39m: [debug] Device is at release version 4.4.2
e[36minfoe[39m: [debug] Device launched! Ready for commands
e[36minfoe[39m: [debug] Setting command timeout to the default of 60 secs
e[36minfoe[39m: [debug] Appium session started with sessionId 5aa552a1-9884-4b7e-b0c8-4a08962ff998
e[36minfoe[39m: e[37m<-- POST /wd/hub/session e[39me[36m303e[39me[90m 22346.103 ms - 74e[39m e[90me[39m
e[36minfoe[39m: e[37m–>e[39m e[37mGETe[39m e[37m/wd/hub/session/5aa552a1-9884-4b7e-b0c8-4a08962ff998e[39m e[90m{}e[39m
e[36minfoe[39m: [debug] Responding to client with success: {“status”:0,“value”:{“platform”:“LINUX”,“browserName”:"",“platformVersion”:“4.4.2”,“webStorageEnabled”:false,“takesScreenshot”:true,“javascriptEnabled”:true,“databaseEnabled”:false,“networkConnectionEnabled”:true,“locationContextEnabled”:false,“warnings”:{},“desired”:{“app”:“C:\Users\Shivkumar roza\Apk\app-prod.apk”,“platformVersion”:“4.3”,“browserName”:"",“takesScreenshot”:true,“app-package”:“com.app.wooplr”,“app-activity”:“com.app.wooplr/.activities.SplashActivity”,“platformName”:“Android”,“device”:“Android”,“deviceName”:“4d19b60056418e85”,“autoAcceptAlerts”:true},“app”:“C:\Users\Shivkumar roza\Apk\app-prod.apk”,“app-package”:“com.app.wooplr”,“app-activity”:“com.app.wooplr/.activities.SplashActivity”,“platformName”:“Android”,“device”:“Android”,“deviceName”:“192.168.1.139:5555”,“autoAcceptAlerts”:true},“sessionId”:“5aa552a1-9884-4b7e-b0c8-4a08962ff998”}
e[36minfoe[39m: e[37m<-- GET /wd/hub/session/5aa552a1-9884-4b7e-b0c8-4a08962ff998 e[39me[32m200e[39me[90m 1.373 ms - 874e[39m e[90m{“status”:0,“value”:{“platform”:“LINUX”,“browserName”:"",“platformVersion”:“4.4.2”,“webStorageEnabled”:false,“takesScreenshot”:true,“javascriptEnabled”:true,“databaseEnabled”:false,“networkConnectionEnabled”:true,“locationContextEnabled”:false,“warnings”:{},“desired”:{“app”:“C:\Users\Shivkumar roza\Apk\app-prod.apk”,“platformVersion”:“4.3”,“browserName”:"",“takesScreenshot”:true,“app-package”:“com.app.wooplr”,“app-activity”:“com.app.wooplr/.activities.SplashActivity”,“platformName”:“Android”,“device”:“Android”,“deviceName”:“4d19b60056418e85”,“autoAcceptAlerts”:true},“app”:“C:\Users\Shivkumar roza\Apk\app-prod.apk”,“app-package”:“com.app.wooplr”,“app-activity”:“com.app.wooplr/.activities.SplashActivity”,“platformName”:“Android”,“device”:“Android”,“deviceName”:“192.168.1.139:5555”,“autoAcceptAlerts”:true},“sessionId”:“5aa552a1-9884-4b7e-b0c8-4a08962ff998”}e[39m
e[36minfoe[39m: e[37m–>e[39m e[37mPOSTe[39m e[37m/wd/hub/session/5aa552a1-9884-4b7e-b0c8-4a08962ff998/timeouts/implicit_waite[39m e[90m{“ms”:60000}e[39m
e[36minfoe[39m: [debug] Set Android implicit wait to 60000ms
e[36minfoe[39m: [debug] Responding to client with success: {“status”:0,“value”:null,“sessionId”:“5aa552a1-9884-4b7e-b0c8-4a08962ff998”}
e[36minfoe[39m: e[37m<-- POST /wd/hub/session/5aa552a1-9884-4b7e-b0c8-4a08962ff998/timeouts/implicit_wait e[39me[32m200e[39me[90m 1.477 ms - 76e[39m e[90m{“status”:0,“value”:null,“sessionId”:“5aa552a1-9884-4b7e-b0c8-4a08962ff998”}e[39m

Hi @bindu
you must use MobileCapabilityType.UDID to select the device, instead of MobileCapabilityType.DEVICE_NAME.
deviceName server capability is only used on iOS simulator as you can see in http://appium.io/slate/en/master/?ruby#appium-server-capabilities1.