title: Unable to get the elements in uiautomator tool when the app is running on the device
body: <p>I am having a setup where web Application in my PC is accessing the app info running on the connected device.(through USB debugging). and continuously sends the app data to the Web Application(PC).</p>
  
  <p>I am automating this using selenium(web GUI) and appium(device) for my automation testing.. </p>
  
  <p>Issue: I am unable to connect to the device from uiautomator.bat tool once the app is getting launched in the device and communicating with the Web app(In my PC).
  Getting the below error. Is there a workaround for this issue.</p>
  
  <p>--------uiautomator.bat log-----------</p>
  
  <p>C:\Users\sat_yug\android-sdks\tools>uiautomatorviewer.bat
  03:57:35 E/DeviceMonitor: Adb connection Error:An existing connection was forcibly closed by the remote host
  03:57:36 E/DeviceMonitor: Connection attempts: 1
  03:57:38 E/DeviceMonitor: Connection attempts: 2
  03:57:40 E/DeviceMonitor: Connection attempts: 3
  03:57:42 E/DeviceMonitor: Connection attempts: 4
  03:57:44 E/DeviceMonitor: Connection attempts: 5
  03:58:04 E/DeviceMonitor: Adb connection Error:An existing connection was forcibly closed by the remote host</p>
  
  <p>------------adb devices log---------------------</p>
  
  <p>C:\Users\sat_yug\android-sdks\platform-tools>adb devices
  List of devices attached
  adb server is out of date.  killing...
  error: could not install <em>smartsocket</em> listener: cannot bind to 127.0.0.1:5037: Only one usage of each socket address (protocol/n
  etwork address/port) is normally permitted. (10048)
  could not read ok from ADB Server
  * failed to start daemon *
  error: cannot connect to daemon</p>
  
  <hr>