I am trying to run below code in appium on wifi. ( Original error: Could not find a connected Android device.)

Below Code is for Launching application in appium but i am unable to launch application remotly using wifi. But when i check adb device it was connected to mobile phone. After running script it cant get connected device in adb…it will kill server

public class TestLauncher
{
public static void main(String[] args) throws MalformedURLException

{

 AppiumDriver driver;
 DesiredCapabilities capabilities=new DesiredCapabilities();

 capabilities.setCapability("noReset","true");
   capabilities.setCapability("fullReset","false");
   capabilities.setCapability("udid","192.168.1.163:5555");
   capabilities.setCapability("deviceName","SWIPE ELITE");
   capabilities.setCapability("platformName","Android");
   capabilities.setCapability("platformVersion","5.0.2");
   capabilities.setCapability("browserName","");

   File file = new File("/home/nishant/APK/SoftController","com.x18thparallel.softcontroller-msg_support_wo_ime_change-vA.3.219.apk");
   capabilities.setCapability("app",file.getAbsolutePath());

   driver = new AndroidDriver(new URL("http://127.0.0.1:4723/wd/hub"),capabilities);

}
}

APPIUM LOGS--------------------------------------------------------------

Please see the log…

Calling AppiumDriver.createSession() with args: [{“appPackage”:“com.x18thparallel.airtel.softgamepad”,“appActivity”:“com.x18thparallel.softcontroller.BluetoothEnableActivity”,“app”:"/home/nishant/APK/SoftController/com.x18thparallel.softcontroller-msg_support_wo_ime_change-vA.3.219.apk",“platformVersion”:“5.0.2”,“browserName”:"",“udid”:“192.168.1.133:5555”,“platformName”:“Android”,“deviceName”:“SWIPE ELITE”},{},{“desiredCapabilities”:{“appPackage”:“com.x18thparallel.airtel.softgamepad”,“appActivity”:“com.x18thparallel.softcontroller.BluetoothEnableActivity”,“app”:"/home/nishant/APK/SoftController/com.x18thparallel.softcontroller-msg_support_wo_ime_change-vA.3.219.apk",“platformVersion”:“5.0.2”,“browserName”:"",“udid”:“192.168.1.133:5555”,“platformName”:“Android”,“deviceName”:“SWIPE ELITE”},“requiredCapabilities”:{},“alwaysMatch”:{“browserName”:"",“platformName”:“Android”},“firstMatch”:[]}]
[debug] [BaseDriver] Event ‘newSessionRequested’ logged at 1510552106309 (11:18:26 GMT+0530 (IST))
[Appium] Creating new AndroidDriver (v1.28.1) session
[Appium] Capabilities:
[Appium] appPackage: ‘com.x18thparallel.airtel.softgamepad’
[Appium] appActivity: ‘com.x18thparallel.softcontroller.BluetoothEnableActivity’
[Appium] app: ‘/home/nishant/APK/SoftController/com.x18thparallel.softcontroller-msg_support_wo_ime_change-vA.3.219.apk’
[Appium] platformVersion: ‘5.0.2’
[Appium] browserName: ‘’
[Appium] udid: ‘192.168.1.133:5555’
[Appium] platformName: ‘Android’
[Appium] deviceName: ‘SWIPE ELITE’
[BaseDriver] Session created with session id: a4815c0e-a937-4748-a23d-3fc319f2473e
[debug] [AndroidDriver] Getting Java version
[AndroidDriver] Java version is: 1.8.0_131
[ADB] Checking whether adb is present
[ADB] Using adb from /home/nishant/platform-tools/adb
[AndroidDriver] Retrieving device list
[debug] [ADB] Trying to find a connected android device
[debug] [ADB] Getting connected devices…
[debug] [ADB] 0 device(s) connected
[debug] [ADB] Could not find devices, restarting adb server…
[debug] [ADB] Restarting adb
[debug] [ADB] Killing adb server on port 5037
[debug] [ADB] Getting connected devices…
[debug] [ADB] 0 device(s) connected
[debug] [ADB] Could not find devices, restarting adb server…
[debug] [ADB] Restarting adb
[debug] [ADB] Killing adb server on port 5037
[debug] [ADB] Getting connected devices…
[debug] [ADB] 0 device(s) connected
[debug] [ADB] Could not find devices, restarting adb server…
[debug] [ADB] Restarting adb
[debug] [ADB] Killing adb server on port 5037
[debug] [ADB] Getting connected devices…
[debug] [ADB] 0 device(s) connected
[debug] [ADB] Could not find devices, restarting adb server…
[debug] [ADB] Restarting adb
[debug] [ADB] Killing adb server on port 5037
[debug] [ADB] Getting connected devices…
[debug] [ADB] 0 device(s) connected
[debug] [ADB] Could not find devices, restarting adb server…
[debug] [ADB] Restarting adb
[debug] [ADB] Killing adb server on port 5037
[debug] [ADB] Getting connected devices…
[debug] [ADB] 0 device(s) connected
[debug] [ADB] Could not find devices, restarting adb server…
[debug] [ADB] Restarting adb
[debug] [ADB] Killing adb server on port 5037
[debug] [ADB] Could not find devices, restarting adb server…
[debug] [ADB] Restarting adb
[debug] [ADB] Killing adb server on port 5037
[debug] [ADB] Could not find devices, restarting adb server…
[debug] [ADB] Restarting adb
[debug] [ADB] Killing adb server on port 5037
[debug] [ADB] Could not find devices, restarting adb server…
[debug] [ADB] Restarting adb
[debug] [ADB] Killing adb server on port 5037
[debug] [ADB] Could not find devices, restarting adb server…
[debug] [ADB] Restarting adb
[debug] [ADB] Killing adb server on port 5037
[debug] [ADB] Could not find devices, restarting adb server…
[debug] [ADB] Restarting adb
[debug] [ADB] Killing adb server on port 5037
[debug] [ADB] Could not find devices, restarting adb server…
[debug] [ADB] Restarting adb
[debug] [ADB] Killing adb server on port 5037
[debug] [AndroidDriver] Shutting down Android driver
[debug] [AndroidDriver] Called deleteSession but bootstrap wasn’t active
[MJSONWP] Encountered internal error running command: Error: Could not find a connected Android device.
at ADB.getDevices$ (…/…/…/lib/tools/system-calls.js:187:13)
at tryCatch (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
at GeneratorFunctionPrototype.invoke [as _invoke] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)
at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
at invoke (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
at enqueueResult (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:185:17)
at Promise ()
at F (/usr/local/lib/node_modules/appium/node_modules/core-js/library/modules/$.export.js:30:36)
at AsyncIterator.enqueue (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:184:12)
at AsyncIterator.prototype.(anonymous function) [as next] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
at Object.runtime.async (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:209:12)
at getDevices (…/…/…/lib/tools/system-calls.js:190:18)
at ADB.getDevices$ (…/…/…/lib/tools/system-calls.js:204:20)
at tryCatch (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
at GeneratorFunctionPrototype.invoke [as _invoke] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)
at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
at GeneratorFunctionPrototype.invoke (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
at
[HTTP] <-- POST /wd/hub/session 500 22903 ms - 179