When the Appium is running, look to the log output as:
Info:welcome to Appium v1.2.0 (rev. E53f49c706a25242e66d36685c268b599cc18da5)
Info:appium REST HTTP Interface listener started on 0.0.0.0:4723
Debug:non-default Server args: {"devicename": "Emulator", "PlatformName": "Android
"}
Info:LogLevel:debug
Info:--post/wd/hub/session {"desiredcapabilities": {"platformversion": "4.2", "
DeviceName ":" Emulator "," PlatformName ":" Android "," appactivity ":". Calculator "," app
Package ":" Com.android.calculator2 "}}
Debug:appium Request initiated At/wd/hub/session
Debug:request received with params: {"desiredcapabilities": {"platformversion": "
4.2 "," DeviceName ":" Emulator "," PlatformName ":" Android "," appactivity ":". Calculator
"," Apppackage ":" Com.android.calculator2 "}}
Debug:didn ' t get app but do get Android package, would attempt to launch it on
The device
Debug:creating New Appium Session 5d16c660-4f6e-47ad-ad5b-b6aa4c276063
Info:starting Android Appium
Debug:using Fast reset? True
Debug:preparing Device for session
Debug:not checking whether app is present since we're assuming it ' s already on
The device
Debug:checking whether ADB is present
debug:using adb from D:\Program files\adt-bundle-windows\sdk\platform-tools\adb
. exe
Info:retrieving Device
Debug:trying to find a connected Android device
Debug:getting Connected devices ...
Debug:executing: "D:\Program files\adt-bundle-windows\sdk\platform-tools\adb.ex
E "Devices
Debug:1 device (s) connected
Info:found Device emulator-5554
debug:setting Device ID to emulator-5554
Debug:waiting for device to is ready and to respond to shell commands (timeout
= 5)
Debug:executing: "D:\Program files\adt-bundle-windows\sdk\platform-tools\adb.ex
E "-S emulator-5554 wait-for-device
Debug:executing: "D:\Program files\adt-bundle-windows\sdk\platform-tools\adb.ex
E "-S emulator-5554 shell" echo ' Ready ' "
Debug:starting Logcat Capture
Error:Logcat Capture Failed:spawn ENOENT
Debug:stopping Logcat Capture
Info: <--Post/wd/hub/session--ms--
The error is: Logcat capture Failed:spawn ENOENT.
After asking the great gods, it is because the path of the SDK contains spaces. the SDK path I modified before is: D:\Program files\adt-bundle-windows\sdk, because Program files contains a space in the middle of the result. Then modify the SDK path to: D:\ADT-BUNDLE-WINDOWS\SDK. Run the script again and discover that the Appium is running correctly and that the script executes successfully.