Test execution on one device gets halt when running same scenario on other device

I am trying to run same test case on multiple emulators. I have created two appium instances which take different port no and UDID as an argument.Consider I have device A and B.When I launched appium with A it launched home activity for an app then it will goes in to the halt state and then session with other device i.e B gets started and it runs successfully. Logs are like this

2017-10-27 08:57:05:020 - info: [Appium] Welcome to Appium v1.7.1
2017-10-27 08:57:05:021 - info: [Appium] Non-default server args:
2017-10-27 08:57:05:021 - info: [Appium] address: 127.0.0.1
2017-10-27 08:57:05:022 - info: [Appium] port: 4700
2017-10-27 08:57:05:022 - info: [Appium] bootstrapPort: 4702
2017-10-27 08:57:05:022 - info: [Appium] sessionOverride: true
2017-10-27 08:57:05:022 - info: [Appium] log: /Users/username/Development/Goibibo/target/{192.168.56.102:5555}.log
2017-10-27 08:57:05:022 - info: [Appium] robotAddress:
2017-10-27 08:57:05:074 - info: [Appium] Appium REST http interface listener started on
2017-10-27 08:57:05:093 - info: [HTTP] --> GET /wd/hub/status {}
2017-10-27 08:57:05:097 - info: [debug] [MJSONWP] Calling AppiumDriver.getStatus() with args: []
2017-10-27 08:57:05:106 - info: [debug] [MJSONWP] Responding to client with driver.getStatus() result: {“build”:{“version”:“1.7.1”,“revision”:null}}
2017-10-27 08:57:05:113 - info: [HTTP] <-- GET /wd/hub/status 200 17 ms - 83
2017-10-27 08:57:05:666 - info: [HTTP] --> POST /wd/hub/session {“desiredCapabilities”:{“app”:"/Users/username/Development/Goibibo/app/Goibibo.apk",“appPackage”:“com.goibibo”,“appActivity”:“com.goibibo.common.HomeActivity”,“newCommandTimeout”:30,“platformVersion”:“5.1”,“platformName”:“Android”,“deviceName”:“Android Device”,“autoAcceptAlerts”:true},“requiredCapabilities”:{},“capabilities”:{“desiredCapabilities”:{“app”:"/Users/username/Development/Goibibo/app/Goibibo.apk",“appPackage”:“com.goibibo”,“appActivity”:“com.goibibo.common.HomeActivity”,“newCommandTimeout”:30,“platformVersion”:“5.1”,“platformName”:“Android”,“deviceName”:“Android Device”,“autoAcceptAlerts”:true},“requiredCapabilities”:{},“alwaysMatch”:{“platformName”:“Android”},“firstMatch”:[]}}
2017-10-27 08:57:05:666 - info: [debug] [MJSONWP] Calling AppiumDriver.createSession() with args: [{“app”:"/Users/username/Development/Goibibo/app/Goibibo.apk",“appPackage”:“com.goibibo”,“appActivity”:“com.goibibo.common.HomeActivity”,“newCommandTimeout”:30,“platformVersion”:“5.1”,“platformName”:“Android”,“deviceName”:“Android Device”,“autoAcceptAlerts”:true},{},{“desiredCapabilities”:{“app”:"/Users/username/Development/Goibibo/app/Goibibo.apk",“appPackage”:“com.goibibo”,“appActivity”:“com.goibibo.common.HomeActivity”,“newCommandTimeout”:30,“platformVersion”:“5.1”,“platformName”:“Android”,“deviceName”:“Android Device”,“autoAcceptAlerts”:true},“requiredCapabilities”:{},“alwaysMatch”:{“platformName”:“Android”},“firstMatch”:[]}]
2017-10-27 08:57:05:667 - info: [debug] [BaseDriver] Event ‘newSessionRequested’ logged at 1509094625667 (14:27:05 GMT+0530 (IST))
2017-10-27 08:57:05:668 - info: [Appium] Creating new AndroidDriver (v1.28.1) session
2017-10-27 08:57:05:669 - info: [Appium] Capabilities:
2017-10-27 08:57:05:670 - info: [Appium] app: ‘/Users/username/Development/Goibibo/app/Goibibo.apk’
2017-10-27 08:57:05:670 - info: [Appium] appPackage: ‘com.goibibo’
2017-10-27 08:57:05:670 - info: [Appium] appActivity: ‘com.goibibo.common.HomeActivity’
2017-10-27 08:57:05:670 - info: [Appium] newCommandTimeout: 30
2017-10-27 08:57:05:670 - info: [Appium] platformVersion: ‘5.1’
2017-10-27 08:57:05:670 - info: [Appium] platformName: ‘Android’
2017-10-27 08:57:05:670 - info: [Appium] deviceName: ‘Android Device’
2017-10-27 08:57:05:670 - info: [Appium] autoAcceptAlerts: true
2017-10-27 08:57:05:678 - warn: [BaseDriver] The following capabilities were provided, but are not recognized by appium: autoAcceptAlerts.
2017-10-27 08:57:05:679 - info: [BaseDriver] Session created with session id: b40b6014-75c4-4d36-b38d-6a1ca825c811
2017-10-27 08:57:05:680 - info: [debug] [AndroidDriver] Getting Java version
2017-10-27 08:57:05:760 - info: [AndroidDriver] Java version is: 1.8.0_144
2017-10-27 08:57:05:763 - info: [ADB] Checking whether adb is present
2017-10-27 08:57:05:765 - info: [ADB] Using adb from /Users/username/Library/Android/sdk/platform-tools/adb
2017-10-27 08:57:05:765 - info: [AndroidDriver] Retrieving device list
2017-10-27 08:57:05:765 - info: [debug] [ADB] Trying to find a connected android device
2017-10-27 08:57:05:766 - info: [debug] [ADB] Getting connected devices…
2017-10-27 08:57:05:779 - info: [debug] [ADB] 2 device(s) connected
2017-10-27 08:57:05:779 - info: [AndroidDriver] Looking for a device with Android ‘5.1’
2017-10-27 08:57:05:779 - info: [debug] [ADB] Setting device id : udid2
2017-10-27 08:57:05:780 - info: [ADB] Getting device platform version
2017-10-27 08:57:05:780 - info: [debug] [ADB] Getting connected devices…
2017-10-27 08:57:05:789 - info: [debug] [ADB] 2 device(s) connected
2017-10-27 08:57:05:791 - info: [debug] [ADB] Running ‘/Users/username/Library/Android/sdk/platform-tools/adb’ with args: ["-P",5037,”-s”,”udid1”,”shell",“getprop”,“ro.build.version.release”]
2017-10-27 08:57:05:804 - info: [debug] [ADB] Current device property ‘ro.build.version.release’: 5.1
2017-10-27 08:57:05:804 - info: [AndroidDriver] Using device:
2017-10-27 08:57:05:805 - info: [ADB] Checking whether adb is present
2017-10-27 08:57:05:805 - info: [ADB] Using adb from /Users/username/Library/Android/sdk/platform-tools/adb
2017-10-27 08:57:05:806 - info: [debug] [ADB] Setting device id to udid2
2017-10-27 08:57:05:806 - info: [BaseDriver] Using local app ‘/Users/username/Development/Goibibo/app/Goibibo.apk’
2017-10-27 08:57:05:806 - info: [debug] [AndroidDriver] Checking whether app is actually present
2017-10-27 08:57:05:807 - info: [AndroidDriver] Starting Android session
2017-10-27 08:57:05:808 - info: [debug] [ADB] Running ‘/Users/username/Library/Android/sdk/platform-tools/adb’ with args: ["-P",5037,"-s",“udid1”,“wait-for-device”]
2017-10-27 08:57:05:817 - info: [debug] [ADB] Getting connected devices…
2017-10-27 08:57:05:825 - info: [debug] [ADB] 2 device(s) connected
2017-10-27 08:57:05:826 - info: [debug] [ADB] Running ‘/Users/username/Library/Android/sdk/platform-tools/adb’ with args: ["-P",5037,"-s",“udid1”,“shell”,“echo”,“ping”]
2017-10-27 08:57:05:837 - info: [debug] [Logcat] Starting logcat capture
2017-10-27 08:57:05:850 - info: [debug] [AndroidDriver] Pushing settings apk to device…
2017-10-27 08:57:05:851 - info: [debug] [ADB] Uninstalling and re-installing ‘io.appium.settings’
2017-10-27 08:57:05:851 - info: [debug] [ADB] Uninstalling io.appium.settings
2017-10-27 08:57:05:852 - info: [debug] [ADB] Getting install status for io.appium.settings
2017-10-27 08:57:05:852 - info: [debug] [ADB] Getting connected devices…
2017-10-27 08:57:05:863 - info: [debug] [ADB] 2 device(s) connected
2017-10-27 08:57:05:863 - info: [debug] [ADB] Running ‘/Users/username/Library/Android/sdk/platform-tools/adb’ with args: ["-P",5037,"-s",“udid1”,“shell”,“pm”,“list”,“packages”,“io.appium.settings”]
2017-10-27 08:57:06:038 - info: [debug] [ADB] App is installed
2017-10-27 08:57:06:039 - info: [debug] [ADB] Getting connected devices…
2017-10-27 08:57:06:050 - info: [debug] [ADB] 2 device(s) connected
2017-10-27 08:57:06:050 - info: [debug] [ADB] Running ‘/Users/username/Library/Android/sdk/platform-tools/adb’ with args: ["-P",5037,"-s",“udid1”,“shell”,“am”,“force-stop”,“io.appium.settings”]
2017-10-27 08:57:06:372 - info: [debug] [ADB] Running ‘/Users/username/Library/Android/sdk/platform-tools/adb’ with args: ["-P",5037,"-s",“udid1”,“uninstall”,“io.appium.settings”]
2017-10-27 08:57:06:641 - info: [debug] [ADB] ADB command output: Success
2017-10-27 08:57:06:641 - info: [ADB] io.appium.settings was successfully uninstalled
2017-10-27 08:57:06:641 - info: [debug] [ADB] Getting install status for io.appium.settings
2017-10-27 08:57:06:641 - info: [debug] [ADB] Getting connected devices…
2017-10-27 08:57:06:659 - info: [debug] [ADB] 2 device(s) connected
2017-10-27 08:57:06:659 - info: [debug] [ADB] Running ‘/Users/username/Library/Android/sdk/platform-tools/adb’ with args: ["-P",5037,"-s",“udid1”,“shell”,“pm”,“list”,“packages”,“io.appium.settings”]
2017-10-27 08:57:06:842 - info: [debug] [ADB] App is not installed
2017-10-27 08:57:06:843 - info: [debug] [ADB] App ‘/usr/local/lib/node_modules/appium/node_modules/io.appium.settings/app/build/outputs/apk/settings_apk-debug.apk’ not installed. Installing
2017-10-27 08:57:06:844 - info: [debug] [ADB] Running ‘/Users/username/Library/Android/sdk/platform-tools/adb’ with args: ["-P",5037,"-s",“udid1”,“install”,"/usr/local/lib/node_modules/appium/node_modules/io.appium.settings/app/build/outputs/apk/settings_apk-debug.apk"]
2017-10-27 08:57:07:118 - info: [debug] [ADB] Getting connected devices…
2017-10-27 08:57:07:127 - info: [debug] [ADB] 2 device(s) connected
2017-10-27 08:57:07:127 - info: [debug] [ADB] Running ‘/Users/username/Library/Android/sdk/platform-tools/adb’ with args: ["-P",5037,"-s",“udid1”,“shell”,“getprop”,“ro.build.version.sdk”]
2017-10-27 08:57:07:139 - info: [debug] [ADB] Current device property ‘ro.build.version.sdk’: 22
2017-10-27 08:57:07:139 - info: [debug] [ADB] Device API level: 22
2017-10-27 08:57:07:139 - info: [debug] [ADB] Getting connected devices…
2017-10-27 08:57:07:147 - info: [debug] [ADB] 2 device(s) connected
2017-10-27 08:57:07:148 - info: [debug] [ADB] Running ‘/Users/username/Library/Android/sdk/platform-tools/adb’ with args: ["-P",5037,"-s",“udid1”,“shell”,“dumpsys”,“package”,“io.appium.settings”]
2017-10-27 08:57:07:163 - info: [debug] [ADB] Getting connected devices…
2017-10-27 08:57:07:172 - info: [debug] [ADB] 2 device(s) connected
2017-10-27 08:57:07:172 - info: [debug] [ADB] Running ‘/Users/username/Library/Android/sdk/platform-tools/adb’ with args: ["-P",5037,"-s",“udid1”,“shell”,“ps”]
2017-10-27 08:57:07:191 - info: [debug] [ADB] Device API level: 22
2017-10-27 08:57:07:192 - info: [debug] [ADB] Getting connected devices…
2017-10-27 08:57:07:199 - info: [debug] [ADB] 2 device(s) connected
2017-10-27 08:57:07:200 - info: [debug] [ADB] Running ‘/Users/username/Library/Android/sdk/platform-tools/adb’ with args: ["-P",5037,"-s",“udid1”,“shell”,“am”,“start”,"-W","-n",“io.appium.settings/.Settings”,"-a",“android.intent.action.MAIN”,"-c",“android.intent.category.LAUNCHER”,"-f",“0x10200000”]
2017-10-27 08:57:08:420 - info: [debug] [ADB] Device API level: 22
2017-10-27 08:57:08:420 - info: [debug] [ADB] Getting connected devices…
2017-10-27 08:57:08:438 - info: [debug] [ADB] 2 device(s) connected
2017-10-27 08:57:08:438 - info: [debug] [ADB] Running ‘/Users/username/Library/Android/sdk/platform-tools/adb’ with args: ["-P",5037,"-s",“udid1”,“shell”,“settings”,“put”,“secure”,“mock_location”,“1”]
2017-10-27 08:57:08:760 - info: [debug] [AndroidDriver] Pushing unlock helper app to device…
2017-10-27 08:57:08:761 - info: [debug] [ADB] Running ‘/Users/username/Library/Android/sdk/platform-tools/adb’ with args: ["-P",5037,"-s",“udid1”,“install”,"/usr/local/lib/node_modules/appium/node_modules/appium-unlock/bin/unlock_apk-debug.apk"]
2017-10-27 08:57:08:946 - info: [ADB] Getting device platform version
2017-10-27 08:57:08:946 - info: [debug] [ADB] Getting connected devices…
2017-10-27 08:57:08:963 - info: [debug] [ADB] 2 device(s) connected
2017-10-27 08:57:08:963 - info: [debug] [ADB] Running ‘/Users/username/Library/Android/sdk/platform-tools/adb’ with args: ["-P",5037,"-s",“udid1”,“shell”,“getprop”,“ro.build.version.release”]
2017-10-27 08:57:08:985 - info: [debug] [ADB] Current device property ‘ro.build.version.release’: 5.1
2017-10-27 08:57:08:986 - info: [debug] [ADB] Getting connected devices…
2017-10-27 08:57:09:007 - info: [debug] [ADB] 2 device(s) connected
2017-10-27 08:57:09:008 - info: [debug] [ADB] Running ‘/Users/username/Library/Android/sdk/platform-tools/adb’ with args: ["-P",5037,"-s",“udid1”,“shell”,“wm”,“size”]
2017-10-27 08:57:09:343 - info: [debug] [ADB] Getting connected devices…
2017-10-27 08:57:09:354 - info: [debug] [ADB] 2 device(s) connected
2017-10-27 08:57:09:354 - info: [debug] [ADB] Running ‘/Users/username/Library/Android/sdk/platform-tools/adb’ with args: ["-P",5037,"-s",“udid1”,“shell”,“getprop”,“ro.product.model”]
2017-10-27 08:57:09:370 - info: [debug] [ADB] Current device property ‘ro.product.model’: Google Nexus 6 - 5.1.0 - API 22 - 1440x2560
2017-10-27 08:57:09:370 - info: [debug] [ADB] Getting connected devices…
2017-10-27 08:57:09:380 - info: [debug] [ADB] 2 device(s) connected
2017-10-27 08:57:09:381 - info: [debug] [ADB] Running ‘/Users/username/Library/Android/sdk/platform-tools/adb’ with args: ["-P",5037,"-s",“udid1”,“shell”,“getprop”,“ro.product.manufacturer”]
2017-10-27 08:57:09:394 - info: [debug] [ADB] Current device property ‘ro.product.manufacturer’: unknown
2017-10-27 08:57:09:458 - info: [AndroidDriver] Remote apk path is /data/local/tmp/3f9cd18113843dcb5ab81bfaffc9f072.apk
2017-10-27 08:57:09:458 - info: [debug] [ADB] Getting connected devices…
2017-10-27 08:57:09:470 - info: [debug] [ADB] 2 device(s) connected
2017-10-27 08:57:09:470 - info: [debug] [ADB] Running ‘/Users/username/Library/Android/sdk/platform-tools/adb’ with args: ["-P",5037,"-s",“udid1”,“shell”,“ls”,"/data/local/tmp/3f9cd18113843dcb5ab81bfaffc9f072.apk"]
2017-10-27 08:57:09:484 - info: [debug] [AndroidDriver] Checking if app is installed
2017-10-27 08:57:09:484 - info: [debug] [ADB] Getting install status for com.goibibo
2017-10-27 08:57:09:485 - info: [debug] [ADB] Getting connected devices…
2017-10-27 08:57:09:493 - info: [debug] [ADB] 2 device(s) connected
2017-10-27 08:57:09:493 - info: [debug] [ADB] Running ‘/Users/username/Library/Android/sdk/platform-tools/adb’ with args: ["-P",5037,"-s",“udid1”,“shell”,“pm”,“list”,“packages”,“com.goibibo”]
2017-10-27 08:57:09:584 - info: [debug] [ADB] App is installed
2017-10-27 08:57:09:584 - info: [AndroidDriver] Apk is already on remote and installed, resetting
2017-10-27 08:57:09:585 - info: [debug] [AndroidDriver] Running fast reset (stop and clear)
2017-10-27 08:57:09:586 - info: [debug] [ADB] Getting connected devices…
2017-10-27 08:57:09:599 - info: [debug] [ADB] 2 device(s) connected
2017-10-27 08:57:09:599 - info: [debug] [ADB] Running ‘/Users/username/Library/Android/sdk/platform-tools/adb’ with args: ["-P",5037,"-s",“udid1”,“shell”,“am”,“force-stop”,“com.goibibo”]
2017-10-27 08:57:09:894 - info: [debug] [ADB] Getting connected devices…
2017-10-27 08:57:09:904 - info: [debug] [ADB] 2 device(s) connected
2017-10-27 08:57:09:905 - info: [debug] [ADB] Running ‘/Users/username/Library/Android/sdk/platform-tools/adb’ with args: ["-P",5037,"-s",“udid1”,“shell”,“pm”,“clear”,“com.goibibo”]
2017-10-27 08:57:10:025 - info: [debug] [AndroidDriver] Extracting strings from apk /Users/username/Development/Goibibo/app/Goibibo.apk null /var/folders/hq/l6jfx1jd155_w2nd5ccwb0l00000gn/T/com.goibibo
2017-10-27 08:57:10:026 - info: [debug] [ADB] Extracting strings for language: default
2017-10-27 08:57:10:026 - info: [debug] [ADB] Device API level: 22
2017-10-27 08:57:10:026 - info: [debug] [ADB] Getting connected devices…
2017-10-27 08:57:10:048 - info: [debug] [ADB] 2 device(s) connected
2017-10-27 08:57:10:049 - info: [debug] [ADB] Running ‘/Users/username/Library/Android/sdk/platform-tools/adb’ with args: ["-P",5037,"-s",“udid1”,“shell”,“getprop”,“persist.sys.language”]
2017-10-27 08:57:10:065 - info: [debug] [ADB] Current device property ‘persist.sys.language’: en
2017-10-27 08:57:11:142 - info: [debug] [ADB] No strings.xml for language ‘en’, getting default strings.xml
2017-10-27 08:57:12:184 - info: [debug] [ADB] Reading strings from converted strings.json
2017-10-27 08:57:12:188 - info: [debug] [ADB] Running ‘/Users/username/Library/Android/sdk/platform-tools/adb’ with args: ["-P",5037,"-s",“udid1”,“push”,"/var/folders/hq/l6jfx1jd155_w2nd5ccwb0l00000gn/T/com.goibibo/strings.json","/data/local/tmp"]
2017-10-27 08:57:12:207 - info: [debug] [AndroidBootstrap] Watching for bootstrap disconnect
2017-10-27 08:57:12:209 - info: [debug] [ADB] Forwarding system: 4702 to device: 4724
2017-10-27 08:57:12:209 - info: [debug] [ADB] Running ‘/Users/username/Library/Android/sdk/platform-tools/adb’ with args: ["-P",5037,"-s",“udid1”,“forward”,“tcp:4702”,“tcp:4724”]
2017-10-27 08:57:12:213 - info: [debug] [UiAutomator] Starting UiAutomator
2017-10-27 08:57:12:213 - info: [debug] [UiAutomator] Moving to state ‘starting’
2017-10-27 08:57:12:214 - info: [debug] [UiAutomator] Parsing uiautomator jar
2017-10-27 08:57:12:214 - info: [debug] [UiAutomator] Found jar name: ‘AppiumBootstrap.jar’
2017-10-27 08:57:12:214 - info: [debug] [ADB] Running ‘/Users/username/Library/Android/sdk/platform-tools/adb’ with args: ["-P",5037,"-s",“udid1”,“push”,"/usr/local/lib/node_modules/appium/node_modules/appium-android-bootstrap/bootstrap/bin/AppiumBootstrap.jar","/data/local/tmp/"]
2017-10-27 08:57:12:233 - info: [debug] [ADB] Attempting to kill all uiautomator processes
2017-10-27 08:57:12:234 - info: [debug] [ADB] Getting all processes with uiautomator
2017-10-27 08:57:12:234 - info: [debug] [ADB] Getting connected devices…
2017-10-27 08:57:12:248 - info: [debug] [ADB] 2 device(s) connected
2017-10-27 08:57:12:248 - info: [debug] [ADB] Running ‘/Users/username/Library/Android/sdk/platform-tools/adb’ with args: ["-P",5037,"-s",“udid1”,“shell”,“ps”]
2017-10-27 08:57:12:268 - info: [ADB] No uiautomator process found to kill, continuing…
2017-10-27 08:57:12:268 - info: [debug] [UiAutomator] Starting UIAutomator
2017-10-27 08:57:12:283 - info: [debug] [ADB] Creating ADB subprocess with args: ["-P",5037,"-s",“udid1”,“shell”,“uiautomator”,“runtest”,“AppiumBootstrap.jar”,"-c",“io.appium.android.bootstrap.Bootstrap”,"-e",“pkg”,“com.goibibo”,"-e",“disableAndroidWatchers”,false,"-e",“acceptSslCerts”,false]
2017-10-27 08:57:12:409 - info: [debug] [UiAutomator] Moving to state ‘online’
2017-10-27 08:57:12:413 - info: [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] json loading complete.
2017-10-27 08:57:12:414 - info: [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Registered crash watchers.
2017-10-27 08:57:12:417 - info: [AndroidBootstrap] Android bootstrap socket is now connected
2017-10-27 08:57:12:420 - info: [debug] [ADB] Getting connected devices…
2017-10-27 08:57:12:422 - info: [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Client connected
2017-10-27 08:57:12:432 - info: [debug] [ADB] 2 device(s) connected
2017-10-27 08:57:12:433 - info: [debug] [ADB] Running ‘/Users/username/Library/Android/sdk/platform-tools/adb’ with args: ["-P",5037,"-s",“udid1”,“shell”,“dumpsys”,“window”]
2017-10-27 08:57:12:452 - info: [AndroidDriver] Screen already unlocked, doing nothing
2017-10-27 08:57:12:453 - info: [debug] [ADB] Device API level: 22
2017-10-27 08:57:12:454 - info: [debug] [ADB] Getting connected devices…
2017-10-27 08:57:12:468 - info: [debug] [ADB] 2 device(s) connected
2017-10-27 08:57:12:469 - info: [debug] [ADB] Running ‘/Users/username/Library/Android/sdk/platform-tools/adb’ with args: ["-P",5037,"-s",“udid1”,“shell”,“am”,“start”,"-W","-n",“com.goibibo/com.goibibo.common.HomeActivity”,"-S","-a",“android.intent.action.MAIN”,"-c",“android.intent.category.LAUNCHER”,"-f",“0x10200000”]
2017-10-27 08:57:14:810 - info: [Appium] New AndroidDriver session created successfully, session b40b6014-75c4-4d36-b38d-6a1ca825c811 added to master session list
2017-10-27 08:57:14:811 - info: [debug] [BaseDriver] Event ‘newSessionStarted’ logged at 1509094634811 (14:27:14 GMT+0530 (IST))
2017-10-27 08:57:14:811 - info: [debug] [MJSONWP] Responding to client with driver.createSession() result: {“platform”:“LINUX”,“webStorageEnabled”:false,“takesScreenshot”:true,“javascriptEnabled”:true,“databaseEnabled”:false,“networkConnectionEnabled”:true,“locationContextEnabled”:false,“warnings”:{},“desired”:{“app”:"/Users/username/Development/Goibibo/app/Goibibo.apk",“appPackage”:“com.goibibo”,“appActivity”:“com.goibibo.common.HomeActivity”,“newCommandTimeout”:30,“platformVersion”:“5.1”,“platformName”:“Android”,“deviceName”:“Android Device”,“autoAcceptAlerts”:true},“app”:"/Users/username/Development/Goibibo/app/Goibibo.apk",“appPackage”:“com.goibibo”,“appActivity”:“com.goibibo.common.HomeActivity”,“newCommandTimeout”:30,“platformVersion”:“5.1”,“platformName”:“Android”,“deviceName”:“udid1”,“autoAcceptAlerts”:true,“deviceUDID”:“udid1”,“deviceScreenSize”:“1440x2560”,“deviceModel”:“Google Nexus 6 - 5.1.0 - API 22 - 1440x2560”,“deviceManufacturer”:“unknown”}
2017-10-27 08:57:14:812 - info: [HTTP] <-- POST /wd/hub/session 200 9146 ms - 967
2017-10-27 08:57:14:905 - info: [HTTP] --> POST /wd/hub/session/b40b6014-75c4-4d36-b38d-6a1ca825c811/timeouts {“type”:“implicit”,“ms”:10000}
2017-10-27 08:57:14:906 - info: [debug] [MJSONWP] Calling AppiumDriver.timeouts() with args: [“implicit”,10000,“b40b6014-75c4-4d36-b38d-6a1ca825c811”]
2017-10-27 08:57:14:908 - info: [debug] [BaseDriver] Set implicit wait to 10000ms
2017-10-27 08:57:14:912 - info: [debug] [MJSONWP] Responding to client with driver.timeouts() result: null
2017-10-27 08:57:14:913 - info: [HTTP] <-- POST /wd/hub/session/b40b6014-75c4-4d36-b38d-6a1ca825c811/timeouts 200 7 ms - 76
2017-10-27 08:57:44:922 - warn: [BaseDriver] Shutting down because we waited 30 seconds for a command
2017-10-27 08:57:44:929 - info: [debug] [AndroidDriver] Shutting down Android driver
2017-10-27 08:57:44:930 - warn: [Appium] Closing session, cause was ‘New Command Timeout of 30 seconds expired. Try customizing the timeout using the ‘newCommandTimeout’ desired capability’
2017-10-27 08:57:44:930 - info: [Appium] Removing session b40b6014-75c4-4d36-b38d-6a1ca825c811 from our master session list
2017-10-27 08:57:44:932 - info: [debug] [ADB] Getting connected devices…
2017-10-27 08:57:44:951 - info: [debug] [ADB] 2 device(s) connected
2017-10-27 08:57:44:952 - info: [debug] [ADB] Running ‘/Users/username/Library/Android/sdk/platform-tools/adb’ with args: ["-P",5037,"-s",“udid1”,“shell”,“am”,“force-stop”,“com.goibibo”]
2017-10-27 08:57:45:322 - info: [debug] [ADB] Pressing the HOME button
2017-10-27 08:57:45:323 - info: [debug] [ADB] Getting connected devices…
2017-10-27 08:57:45:336 - info: [debug] [ADB] 2 device(s) connected
2017-10-27 08:57:45:337 - info: [debug] [ADB] Running ‘/Users/username/Library/Android/sdk/platform-tools/adb’ with args: ["-P",5037,"-s",“udid1”,“shell”,“input”,“keyevent”,3]
2017-10-27 08:57:45:966 - info: [debug] [AndroidBootstrap] Sending command to android: {“cmd”:“shutdown”}
2017-10-27 08:57:45:974 - info: [debug] [AndroidBootstrap] Received command result from bootstrap
2017-10-27 08:57:45:975 - info: [debug] [UiAutomator] Shutting down UiAutomator
2017-10-27 08:57:45:976 - info: [debug] [UiAutomator] Moving to state ‘stopping’
2017-10-27 08:57:45:979 - info: [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got data from client: {“cmd”:“shutdown”}
2017-10-27 08:57:45:979 - info: [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command of type SHUTDOWN
2017-10-27 08:57:45:979 - info: [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Returning result: {“status”:0,“value”:“OK, shutting down”}
2017-10-27 08:57:45:979 - info: [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Closed client connection
2017-10-27 08:57:45:979 - info: [debug] [AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_STATUS: numtests=1
2017-10-27 08:57:45:979 - info: [debug] [AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_STATUS: stream=.
2017-10-27 08:57:45:980 - info: [debug] [AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_STATUS: id=UiAutomatorTestRunner
2017-10-27 08:57:45:980 - info: [debug] [AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_STATUS: test=testRunServer
2017-10-27 08:57:45:980 - info: [debug] [AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_STATUS: class=io.appium.android.bootstrap.Bootstrap
2017-10-27 08:57:45:980 - info: [debug] [AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_STATUS: current=1
2017-10-27 08:57:45:980 - info: [debug] [AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_STATUS_CODE: 0
2017-10-27 08:57:45:980 - info: [debug] [AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_STATUS: stream=
2017-10-27 08:57:45:980 - info: [debug] [AndroidBootstrap] [UIAUTO STDOUT] Test results for WatcherResultPrinter=.
2017-10-27 08:57:45:980 - info: [debug] [AndroidBootstrap] [UIAUTO STDOUT] Time: 33.587
2017-10-27 08:57:45:980 - info: [debug] [AndroidBootstrap] [UIAUTO STDOUT] OK (1 test)
2017-10-27 08:57:45:980 - info: [debug] [AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_STATUS_CODE: -1
2017-10-27 08:57:45:986 - info: [debug] [UiAutomator] UiAutomator shut down normally
2017-10-27 08:57:45:986 - info: [debug] [UiAutomator] Moving to state ‘stopped’
2017-10-27 08:57:45:986 - info: [debug] [ADB] Attempting to kill all uiautomator processes
2017-10-27 08:57:45:986 - info: [debug] [ADB] Getting all processes with uiautomator
2017-10-27 08:57:45:986 - info: [debug] [ADB] Getting connected devices…
2017-10-27 08:57:46:002 - info: [debug] [ADB] 2 device(s) connected
2017-10-27 08:57:46:003 - info: [debug] [ADB] Running ‘/Users/username/Library/Android/sdk/platform-tools/adb’ with args: ["-P",5037,"-s",“udid1”,“shell”,“ps”]
2017-10-27 08:57:46:060 - info: [ADB] No uiautomator process found to kill, continuing…
2017-10-27 08:57:46:061 - info: [debug] [UiAutomator] Moving to state ‘stopped’
2017-10-27 08:57:46:061 - info: [debug] [Logcat] Stopping logcat capture
2017-10-27 08:57:46:064 - info: [debug] [ADB] Getting connected devices…
2017-10-27 08:57:46:076 - info: [debug] [ADB] 2 device(s) connected
2017-10-27 08:57:46:077 - info: [debug] [ADB] Running ‘/Users/username/Library/Android/sdk/platform-tools/adb’ with args: ["-P",5037,"-s",“udid1”,“shell”,“am”,“force-stop”,“io.appium.unlock”]
2017-10-27 08:57:46:438 - info: [debug] [AndroidDriver] Not cleaning generated files. Add clearSystemFiles capability if wanted.

Let me know.Why is this happening.Why it is moving from udid2 to udid1