Appium 'Failed to connect to the server. Please check that it is running' using Inspector
<p>What must be done to use Aappium's inspector?</p>

<p>The screenshot and logs are attached</p>

<ol>
<li>my appium server is set to start an app (with path checked)</li>
<li>the AVD emulator is launched</li>
<li>the tests script is launched, with the app successfully loading on the emulator</li>
<li>when clicking on the 'inspector' button, the above error occurs</li>
</ol>

<p><a href="http://i.stack.imgur.com/VXyah.png" rel="nofollow"><img src="http://i.stack.imgur.com/VXyah.png" alt="Error displayed"></a></p>

<blockquote>
  <p>Launching Appium server with command: C:\Program Files (x86)\Appium\node.exe lib\server\main.js --address 127.0.0.1 --port 4723 --app C:\test\TimeWorksMobile.apk --platform-name Android --platform-version 23 --automation-name Appium --log-no-color
  info: Welcome to Appium v1.4.16 (REV ae6877eff263066b26328d457bd285c0cc62430d)
  info: Appium REST http interface listener started on 127.0.0.1:4723
  info: [debug] Non-default server args: {"app":"C:\test\TimeWorksMobile.apk","address":"127.0.0.1","logNoColors":true,"platformName":"Android","platformVersion":"23","automationName":"Appium"}
  info: Console LogLevel: debug
  info: --> POST /wd/hub/session {"requiredCapabilities":{},"desiredCapabilities":{"platformVersion":"5.1","app":"C:\test\TimeWorksMobile.apk","deviceName":"Android Emulator","platformName":"Android"}}
  info: Client User-Agent string: Python-urllib/3.5
  info: [debug] No appActivity desired capability or server param. Parsing from apk.
  info: [debug] No appPackage desired capability or server param. Parsing from apk.
  info: [debug] Using local app from desired caps: C:\test\TimeWorksMobile.apk
  info: [debug] Creating new appium session 2c9eecab-c67b-45e0-b97f-0faa98dfd000
  info: Starting android appium
  info: [debug] Getting Java version
  info: Java version is: 1.8.0_101
  info: [debug] Checking whether adb is present
  info: [debug] Using adb from C:\Users\mwebster\AppData\Local\Android\sdk\platform-tools\adb.exe
  info: [debug] Parsing package and activity from app manifest
  info: [debug] Checking whether aapt is present
  info: [debug] Using aapt from C:\Users\mwebster\AppData\Local\Android\sdk\build-tools\24.0.2\aapt.exe
  info: [debug] Extracting package and launch activity from manifest.
  info: [debug] executing cmd: C:\Users\mwebster\AppData\Local\Android\sdk\build-tools\24.0.2\aapt.exe dump badging C:\test\TimeWorksMobile.apk
  info: [debug] badging package: com.SwipeClock.SCeConnect
  info: [debug] badging act: com.SwipeClock.SCeConnect.MainActivity
  info: [debug] Parsed package and activity are: com.SwipeClock.SCeConnect/com.SwipeClock.SCeConnect.MainActivity
  info: [debug] Using fast reset? true
  info: [debug] Preparing device for session
  info: [debug] Checking whether app is actually present
  info: Retrieving device
  info: [debug] Trying to find a connected android device
  info: [debug] Getting connected devices...
  info: [debug] executing cmd: C:\Users\mwebster\AppData\Local\Android\sdk\platform-tools\adb.exe devices
  info: [debug] 1 device(s) connected
  info: Found device emulator-5554
  info: [debug] Setting device id to emulator-5554
  info: [debug] Waiting for device to be ready and to respond to shell commands (timeout = 5)
  info: [debug] executing cmd: C:\Users\mwebster\AppData\Local\Android\sdk\platform-tools\adb.exe -s emulator-5554 wait-for-device
  info: [debug] executing cmd: C:\Users\mwebster\AppData\Local\Android\sdk\platform-tools\adb.exe -s emulator-5554 shell "echo 'ready'"
  info: [debug] Starting logcat capture
  info: [debug] Getting device API level
  info: [debug] executing cmd: C:\Users\mwebster\AppData\Local\Android\sdk\platform-tools\adb.exe -s emulator-5554 shell "getprop ro.build.version.sdk"
  info: [debug] Device is at API Level 23
  info: Device API level is: 23
  info: [debug] Extracting strings for language: default
  info: [debug] executing cmd: C:\Users\mwebster\AppData\Local\Android\sdk\platform-tools\adb.exe -s emulator-5554 shell "getprop persist.sys.language"
  info: [debug] Current device persist.sys.language: 
  info: [debug] java -jar "C:\Program Files (x86)\Appium\node_modules\appium\node_modules\appium-adb\jars\appium_apk_tools.jar" "stringsFromApk" "C:\test\TimeWorksMobile.apk" "C:\Users\mwebster\AppData\Local\Temp\com.SwipeClock.SCeConnect" 
  info: [debug] Reading strings from converted strings.json
  info: [debug] Setting language to default
  info: [debug] executing cmd: C:\Users\mwebster\AppData\Local\Android\sdk\platform-tools\adb.exe -s emulator-5554 push "C:\Users\mwebster\AppData\Local\Temp\com.SwipeClock.SCeConnect\strings.json" /data/local/tmp
  info: [debug] Checking whether aapt is present
  info: [debug] Using aapt from C:\Users\mwebster\AppData\Local\Android\sdk\build-tools\24.0.2\aapt.exe
  info: [debug] Retrieving process from manifest.
  info: [debug] executing cmd: C:\Users\mwebster\AppData\Local\Android\sdk\build-tools\24.0.2\aapt.exe dump xmltree C:\test\TimeWorksMobile.apk AndroidManifest.xml
  info: [debug] Set app process to: com.SwipeClock.SCeConnect
  info: [debug] Not uninstalling app since server not started with --full-reset
  info: [debug] Checking app cert for C:\test\TimeWorksMobile.apk.
  info: [debug] executing cmd: java -jar "C:\Program Files (x86)\Appium\node_modules\appium\node_modules\appium-adb\jars\verify.jar" C:\test\TimeWorksMobile.apk
  info: [debug] App already signed.
  info: [debug] Zip-aligning C:\test\TimeWorksMobile.apk
  info: [debug] Checking whether zipalign is present
  info: [debug] Using zipalign from C:\Users\mwebster\AppData\Local\Android\sdk\build-tools\24.0.2\zipalign.exe
  info: [debug] Zip-aligning apk.
  info: [debug] executing cmd: C:\Users\mwebster\AppData\Local\Android\sdk\build-tools\24.0.2\zipalign.exe -f 4 C:\test\TimeWorksMobile.apk C:\Users\mwebster\AppData\Local\Temp\116910-12700-dn10cl\appium.tmp
  info: [debug] MD5 for app is 49680e5f3c45e35b7ae704bcc2859d86
  info: [debug] executing cmd: C:\Users\mwebster\AppData\Local\Android\sdk\platform-tools\adb.exe -s emulator-5554 shell "ls /data/local/tmp/49680e5f3c45e35b7ae704bcc2859d86.apk"
  info: [debug] Getting install status for com.SwipeClock.SCeConnect
  info: [debug] Getting device API level
  info: [debug] executing cmd: C:\Users\mwebster\AppData\Local\Android\sdk\platform-tools\adb.exe -s emulator-5554 shell "getprop ro.build.version.sdk"
  info: [debug] Device is at API Level 23
  info: [debug] executing cmd: C:\Users\mwebster\AppData\Local\Android\sdk\platform-tools\adb.exe -s emulator-5554 shell "pm list packages -3 com.SwipeClock.SCeConnect"
  info: [debug] App is installed
  info: App is already installed, resetting app
  info: [debug] Running fast reset (stop and clear)
  info: [debug] executing cmd: C:\Users\mwebster\AppData\Local\Android\sdk\platform-tools\adb.exe -s emulator-5554 shell "am force-stop com.SwipeClock.SCeConnect"
  info: [debug] executing cmd: C:\Users\mwebster\AppData\Local\Android\sdk\platform-tools\adb.exe -s emulator-5554 shell "pm clear com.SwipeClock.SCeConnect"
  info: [debug] Forwarding system:4724 to device:4724
  info: [debug] executing cmd: C:\Users\mwebster\AppData\Local\Android\sdk\platform-tools\adb.exe -s emulator-5554 forward tcp:4724 tcp:4724
  info: [debug] Pushing appium bootstrap to device...
  info: [debug] executing cmd: C:\Users\mwebster\AppData\Local\Android\sdk\platform-tools\adb.exe -s emulator-5554 push "C:\Program Files (x86)\Appium\node_modules\appium\build\android_bootstrap\AppiumBootstrap.jar" /data/local/tmp/
  info: [debug] Pushing settings apk to device...
  info: [debug] executing cmd: C:\Users\mwebster\AppData\Local\Android\sdk\platform-tools\adb.exe -s emulator-5554 install "C:\Program Files (x86)\Appium\node_modules\appium\build\settings_apk\settings_apk-debug.apk"
  info: [debug] Pushing unlock helper app to device...
  info: [debug] executing cmd: C:\Users\mwebster\AppData\Local\Android\sdk\platform-tools\adb.exe -s emulator-5554 install "C:\Program Files (x86)\Appium\node_modules\appium\build\unlock_apk\unlock_apk-debug.apk"
  info: Starting App
  info: [debug] Attempting to kill all 'uiautomator' processes
  info: [debug] Getting all processes with 'uiautomator'
  info: [debug] executing cmd: C:\Users\mwebster\AppData\Local\Android\sdk\platform-tools\adb.exe -s emulator-5554 shell "ps 'uiautomator'"
  info: [debug] No matching processes found
  info: [debug] Running bootstrap
  info: [debug] spawning: C:\Users\mwebster\AppData\Local\Android\sdk\platform-tools\adb.exe -s emulator-5554 shell uiautomator runtest AppiumBootstrap.jar -c io.appium.android.bootstrap.Bootstrap -e pkg com.SwipeClock.SCeConnect -e disableAndroidWatchers false
  info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: numtests=1
  info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: stream=
  info: [debug] [UIAUTOMATOR STDOUT] io.appium.android.bootstrap.Bootstrap:
  info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: id=UiAutomatorTestRunner
  info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: test=testRunServer
  info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: class=io.appium.android.bootstrap.Bootstrap
  info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: current=1
  info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS_CODE: 1
  info: [debug] [BOOTSTRAP] [debug] Socket opened on port 4724
  info: [debug] [BOOTSTRAP] [debug] Appium Socket Server Ready
  info: [debug] [BOOTSTRAP] [debug] Loading json...
  info: [debug] [BOOTSTRAP] [debug] json loading complete.
  info: [debug] [BOOTSTRAP] [debug] Registered crash watchers.
  info: [debug] Waking up device if it's not alive
  info: [debug] Pushing command to appium work queue: ["wake",{}]
  info: [debug] [BOOTSTRAP] [debug] Client connected
  info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"wake","params":{}}
  info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
  info: [debug] [BOOTSTRAP] [debug] Got command action: wake
  info: [debug] [BOOTSTRAP] [debug] Returning result: {"status":0,"value":true}
  info: [debug] executing cmd: C:\Users\mwebster\AppData\Local\Android\sdk\platform-tools\adb.exe -s emulator-5554 shell "dumpsys window"
  info: [debug] Screen already unlocked, continuing.
  info: [debug] Pushing command to appium work queue: ["getDataDir",{}]
  info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"getDataDir","params":{}}
  info: [debug] dataDir set to: /data
  info: [debug] Pushing command to appium work queue: ["compressedLayoutHierarchy",{"compressLayout":false}]
  info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
  info: [debug] [BOOTSTRAP] [debug] Got command action: getDataDir
  info: [debug] [BOOTSTRAP] [debug] Returning result: {"status":0,"value":"/data"}
  info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"compressedLayoutHierarchy","params":{"compressLayout":false}}
  info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
  info: [debug] [BOOTSTRAP] [debug] Got command action: compressedLayoutHierarchy
  info: [debug] Getting device API level
  info: [debug] executing cmd: C:\Users\mwebster\AppData\Local\Android\sdk\platform-tools\adb.exe -s emulator-5554 shell "getprop ro.build.version.sdk"
  info: [debug] [BOOTSTRAP] [debug] Returning result: {"status":0,"value":false}
  info: [debug] Device is at API Level 23
  info: [debug] executing cmd: C:\Users\mwebster\AppData\Local\Android\sdk\platform-tools\adb.exe -s emulator-5554 shell "am start -S -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -f 0x10200000 -n com.SwipeClock.SCeConnect/com.SwipeClock.SCeConnect.MainActivity"
  info: [debug] Waiting for pkg "com.SwipeClock.SCeConnect" and activity "com.SwipeClock.SCeConnect.MainActivity" to be focused
  info: [debug] Getting focused package and activity
  info: [debug] executing cmd: C:\Users\mwebster\AppData\Local\Android\sdk\platform-tools\adb.exe -s emulator-5554 shell "dumpsys window windows"
  info: [debug] executing cmd: C:\Users\mwebster\AppData\Local\Android\sdk\platform-tools\adb.exe -s emulator-5554 shell "getprop ro.build.version.release"
  info: [debug] Device is at release version 6.0
  info: [debug] Device launched! Ready for commands
  info: [debug] Setting command timeout to the default of 60 secs
  info: [debug] Appium session started with sessionId 2c9eecab-c67b-45e0-b97f-0faa98dfd000
  info: &lt;-- POST /wd/hub/session 303 4044.963 ms - 74 
  info: --> GET /wd/hub/session/2c9eecab-c67b-45e0-b97f-0faa98dfd000 {}
  info: [debug] Responding to client with success: {"status":0,"value":{"platform":"LINUX","browserName":"Android","platformVersion":"6.0","webStorageEnabled":false,"takesScreenshot":true,"javascriptEnabled":true,"databaseEnabled":false,"networkConnectionEnabled":true,"locationContextEnabled":false,"warnings":{},"desired":{"platformVersion":"5.1","app":"C:\test\TimeWorksMobile.apk","deviceName":"Android Emulator","platformName":"Android"},"app":"C:\test\TimeWorksMobile.apk","deviceName":"emulator-5554","platformName":"Android"},"sessionId":"2c9eecab-c67b-45e0-b97f-0faa98dfd000"}
  info: &lt;-- GET /wd/hub/session/2c9eecab-c67b-45e0-b97f-0faa98dfd000 200 3.418 ms - 538 {"status":0,"value":{"platform":"LINUX","browserName":"Android","platformVersion":"6.0","webStorageEnabled":false,"takesScreenshot":true,"javascriptEnabled":true,"databaseEnabled":false,"networkConnectionEnabled":true,"locationContextEnabled":false,"warnings":{},"desired":{"platformVersion":"5.1","app":"C:\test\TimeWorksMobile.apk","deviceName":"Android Emulator","platformName":"Android"},"app":"C:\test\TimeWorksMobile.apk","deviceName":"emulator-5554","platformName":"Android"},"sessionId":"2c9eecab-c67b-45e0-b97f-0faa98dfd000"}
  {"platform":"LINUX","browserName":"Android","platformVersion":"6.0","webStorageEnabled":false,"takesScreenshot":true,"javascriptEnabled":true,"databaseEnabled":false,"networkConnectionEnabled":true,"locationContextEnabled":false,"warnings":{},"desired":{"platformVersion":"5.1","app":"C:\test\TimeWorksMobile.apk","deviceName":"Android Emulator","platformName":"Android"},"app":"C:\test\TimeWorksMobile.apk","deviceName":"emulator-5554","platformName":"Android"},"sessionId":"2c9eecab-c67b-45e0-b97f-0faa98dfd000"}
  info: --> POST /wd/hub/session {"desiredCapabilities":{"app":"C:\test\TimeWorksMobile.apk","platformName":"Android"}}
  info: Client User-Agent string: undefined
  error: Failed to start an Appium session, err was: Error: Requested a new session but one was in progress
  info: [debug] Error: Requested a new session but one was in progress
      at [object Object].Appium.start (C:\Program Files (x86)\Appium\node_modules\appium\lib\appium.js:139:15)
      at exports.createSession (C:\Program Files (x86)\Appium\node_modules\appium\lib\server\controller.js:188:16)
      at Layer.handle [as handle_request] (C:\Program Files (x86)\Appium\node_modules\appium\node_modules\express\lib\router\layer.js:82:5)
      at next (C:\Program Files (x86)\Appium\node_modules\appium\node_modules\express\lib\router\route.js:110:13)
      at Route.dispatch (C:\Program Files (x86)\Appium\node_modules\appium\node_modules\express\lib\router\route.js:91:3)
      at Layer.handle [as handle_request] (C:\Program Files (x86)\Appium\node_modules\appium\node_modules\express\lib\router\layer.js:82:5)
      at C:\Program Files (x86)\Appium\node_modules\appium\node_modules\express\lib\router\index.js:267:22
      at Function.proto.process_params (C:\Program Files (x86)\Appium\node_modules\appium\node_modules\express\lib\router\index.js:321:12)
      at next (C:\Program Files (x86)\Appium\node_modules\appium\node_modules\express\lib\router\index.js:261:10)
      at next (C:\Program Files (x86)\Appium\node_modules\appium\node_modules\express\lib\router\route.js:100:14)
      at next (C:\Program Files (x86)\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
      at next (C:\Program Files (x86)\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
      at next (C:\Program Files (x86)\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
      at next (C:\Program Files (x86)\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
      at next (C:\Program Files (x86)\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
      at next (C:\Program Files (x86)\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
      at next (C:\Program Files (x86)\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
      at next (C:\Program Files (x86)\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
      at next (C:\Program Files (x86)\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
      at next (C:\Program Files (x86)\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
      at C:\Program Files (x86)\Appium\node_modules\appium\lib\server\controller.js:39:7
      at Layer.handle [as handle_request] (C:\Program Files (x86)\Appium\node_modules\appium\node_modules\express\lib\router\layer.js:82:5)
      at next (C:\Program Files (x86)\Appium\node_modules\appium\node_modules\express\lib\router\route.js:110:13)
      at next (C:\Program Files (x86)\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
      at next (C:\Program Files (x86)\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
      at next (C:\Program Files (x86)\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
      at next (C:\Program Files (x86)\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
      at next (C:\Program Files (x86)\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
      at next (C:\Program Files (x86)\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
      at next (C:\Program Files (x86)\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
      at next (C:\Program Files (x86)\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
      at next (C:\Program Files (x86)\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
      at next (C:\Program Files (x86)\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
      at next (C:\Program Files (x86)\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
      at next (C:\Program Files (x86)\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
      at next (C:\Program Files (x86)\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
      at next (C:\Program Files (x86)\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
      at next (C:\Program Files (x86)\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
      at Route.dispatch (C:\Program Files (x86)\Appium\node_modules\appium\node_modules\express\lib\router\route.js:91:3)
      at Layer.handle [as handle_request] (C:\Program Files (x86)\Appium\node_modules\appium\node_modules\express\lib\router\layer.js:82:5)
      at C:\Program Files (x86)\Appium\node_modules\appium\node_modules\express\lib\router\index.js:267:22
      at Function.proto.process_params (C:\Program Files (x86)\Appium\node_modules\appium\node_modules\express\lib\router\index.js:321:12)
      at next (C:\Program Files (x86)\Appium\node_modules\appium\node_modules\express\lib\router\index.js:261:10)
      at methodOverride (C:\Program Files (x86)\Appium\node_modules\appium\node_modules\method-override\index.js:79:5)
      at Layer.handle [as handle_request] (C:\Program Files (x86)\Appium\node_modules\appium\node_modules\express\lib\router\layer.js:82:5)
      at trim_prefix (C:\Program Files (x86)\Appium\node_modules\appium\node_modules\express\lib\router\index.js:302:13)
      at C:\Program Files (x86)\Appium\node_modules\appium\node_modules\express\lib\router\index.js:270:7
      at Function.proto.process_params (C:\Program Files (x86)\Appium\node_modules\appium\node_modules\express\lib\router\index.js:321:12)
      at next (C:\Program Files (x86)\Appium\node_modules\appium\node_modules\express\lib\router\index.js:261:10)
      at logger (C:\Program Files (x86)\Appium\node_modules\appium\node_modules\morgan\index.js:136:5)
      at Layer.handle [as handle_request] (C:\Program Files (x86)\Appium\node_modules\appium\node_modules\express\lib\router\layer.js:82:5)
      at trim_prefix (C:\Program Files (x86)\Appium\node_modules\appium\node_modules\express\lib\router\index.js:302:13)
      at C:\Program Files (x86)\Appium\node_modules\appium\node_modules\express\lib\router\index.js:270:7
      at Function.proto.process_params (C:\Program Files (x86)\Appium\node_modules\appium\node_modules\express\lib\router\index.js:321:12)
      at next (C:\Program Files (x86)\Appium\node_modules\appium\node_modules\express\lib\router\index.js:261:10)
      at C:\Program Files (x86)\Appium\node_modules\appium\node_modules\body-parser\lib\read.js:111:5
      at done (C:\Program Files (x86)\Appium\node_modules\appium\node_modules\body-parser\node_modules\raw-body\index.js:248:14)
      at IncomingMessage.onEnd (C:\Program Files (x86)\Appium\node_modules\appium\node_modules\body-parser\node_modules\raw-body\index.js:294:7)
      at IncomingMessage.g (events.js:199:16)
      at IncomingMessage.emit (events.js:104:17)
      at _stream_readable.js:908:16
      at process._tickDomainCallback (node.js:381:11)
  info: [debug] Responding to client with error: {"status":33,"value":{"message":"A new session could not be created. (Original error: Requested a new session but one was in progress)","origValue":"Requested a new session but one was in progress"},"sessionId":"2c9eecab-c67b-45e0-b97f-0faa98dfd000"}
  info: &lt;-- POST /wd/hub/session 500 6.272 ms - 250 
  info: [debug] Didn't get a new command in 60 secs, shutting down...
  info: Shutting down appium session
  info: [debug] Pressing the HOME button
  info: [debug] executing cmd: C:\Users\mwebster\AppData\Local\Android\sdk\platform-tools\adb.exe -s emulator-5554 shell "input keyevent 3"
  info: [debug] Stopping logcat capture
  info: [debug] Logcat terminated with code null, signal SIGTERM
  info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"shutdown"}
  info: [debug] [BOOTSTRAP] [debug] Got command of type SHUTDOWN
  info: [debug] [BOOTSTRAP] [debug] Returning result: {"status":0,"value":"OK, shutting down"}
  info: [debug] [BOOTSTRAP] [debug] Closed client connection
  info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: numtests=1
  info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: stream=.
  info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: id=UiAutomatorTestRunner
  info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: test=testRunServer
  info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: class=io.appium.android.bootstrap.Bootstrap
  info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: current=1
  info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS_CODE: 0
  info: [debug] Sent shutdown command, waiting for UiAutomator to stop...
  info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: stream=
  info: [debug] [UIAUTOMATOR STDOUT] Test results for WatcherResultPrinter=.
  info: [debug] [UIAUTOMATOR STDOUT] Time: 61.482
  info: [debug] [UIAUTOMATOR STDOUT] OK (1 test)
  info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS_CODE: -1
  info: [debug] UiAutomator shut down normally
  info: [debug] Cleaning up android objects
  info: [debug] Cleaning up appium session
  info: [debug] We shut down because no new commands came in</p>
</blockquote>

<p>Appium internally uses UIAutomator to find elements. If you are executing your code using appium then your UIAutomator is already in use and if you try to use it manually then appium will loose the control of UIAutomator.</p>

python appium inspector