title: Facing issue while running appium script on android devices
body: <p>Error on console</p>
  
  <blockquote>
    <p>java.lang.reflect.InvocationTargetException
        Unable to create a new remote session. Please check the server log for more details. Original error: An unknown server-side error
    occurred while processing the command. Original error: Error finding
    if 'io.appium.uiautomator2.server.test' is installed. Original error:
    Error executing adbExec. Original error: 'Command
    'C:\Users\Ram\AppData\Local\Android\Sdk\platform-tools\adb.exe
    -P 5037 -s 6219a1bc shell dumpsys package io.appium.uiautomator2.server.test' exited with code 1'; Stderr:
    'error: device '6219a1bc' not found'; Code: '1'
        Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'
        System info: host: 'DESKTOP-KVSADD9', ip: '192.168.0.121', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0',
    java.version: '1.8.0_171'
        Driver info: driver.version: AppiumDriver
        remote stacktrace: UnknownError: An unknown server-side error occurred while processing the command. Original error: Error finding
    if 'io.appium.uiautomator2.server.test' is installed. Original error:
    Error executing adbExec. Original error: 'Command
    'C:\Users\Ram\AppData\Local\Android\Sdk\platform-tools\adb.exe
    -P 5037 -s 6219a1bc shell dumpsys package io.appium.uiautomator2.server.test' exited with code 1'; Stderr:
    'error: device '6219a1bc' not found'; Code: '1'
            at getResponseForW3CError (C:\Program Files\Appium\resources\app\node_modules\appium\node_modules\appium-base-driver\lib\protocol\errors.js:826:9)
            at asyncHandler (C:\Program Files\Appium\resources\app\node_modules\appium\node_modules\appium-base-driver\lib\protocol\protocol.js:388:37)
            at process._tickCallback (internal/process/next_tick.js:68:7)
        Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'
        System info: host: 'DESKTOP-KVSADD9', ip: '192.168.0.121', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0',
    java.version: '1.8.0_171'
        Driver info: driver.version: AppiumDriver
        org.openqa.selenium.SessionNotCreatedException: Unable to create a new remote session. Please check the server log for more details.
    Original error: An unknown server-side error occurred while processing
    the command. Original error: Error finding if
    'io.appium.uiautomator2.server.test' is installed. Original error:
    Error executing adbExec. Original error: 'Command
    'C:\Users\Ram\AppData\Local\Android\Sdk\platform-tools\adb.exe
    -P 5037 -s 6219a1bc shell dumpsys package io.appium.uiautomator2.server.test' exited with code 1'; Stderr:
    'error: device '6219a1bc' not found'; Code: '1'
        Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'
        System info: host: 'DESKTOP-KVSADD9', ip: '192.168.0.121', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0',
    java.version: '1.8.0_171'
        Driver info: driver.version: AppiumDriver
        remote stacktrace: UnknownError: An unknown server-side error occurred while processing the command. Original error: Error finding
    if 'io.appium.uiautomator2.server.test' is installed. Original error:
    Error executing adbExec. Original error: 'Command</p>
  </blockquote>
  
  <p>I am trying to run the script on real device. Most of the time script is not getting run and wherever script is running my device is getting restart automatically.</p>
  
  <p>Any one facing this issue? </p>