Warn: No app capability, can't parse package/activity

Problem
The Demo can be run successfully in the past
And recently I want to run again, there is some thing wrong with it .

The following are my steps:

  1. Launch the emulator

2.Open the Appium and Launch it

3.Run the Python code

Code
#coding=utf-8
from appium import webdriver
desired_caps = {}
desired_caps[‘platformName’] = ‘Android’
desired_caps[‘platformVersion’] = ‘4.4.2’
desired_caps[‘deviceName’] = ‘Android Emulator’
desired_caps[‘appPackage’] = ‘com.android.calculator2’
desired_caps[‘appActivity’] = ‘.Calculator’
driver = webdriver.Remote(‘http://localhost:4723/wd/hub’, desired_caps)
driver.find_element_by_name(“1”).click()
driver.find_element_by_name(“5”).click()
driver.find_element_by_name(“9”).click()
driver.find_element_by_name(“delete”).click()
driver.find_element_by_name(“9”).click()
driver.find_element_by_name(“5”).click()
driver.find_element_by_name(“+”).click()
driver.find_element_by_name(“6”).click()
driver.find_element_by_name(“=”).click()
driver.quit()

Log

Launching Appium server with command: C:\Program Files (x86)\Appium\node.exe lib\server\main.js --address 127.0.0.1 --port 4723 --avd Android4.4.2_test --platform-name Android --platform-version 19 --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: {“address”:“127.0.0.1”,“logNoColors”:true,“avd”:“Android4.4.2_test”,“platformName”:“Android”,“platformVersion”:“19”,“automationName”:“Appium”}
info: Console LogLevel: debug
info: → POST /wd/hub/session {“desiredCapabilities”:{“platformVersion”:“4.4.2”,“deviceName”:“Android Emulator”,“platformName”:“Android”,“appActivity”:“.Calculator”,“appPackage”:“com.android.calculator2”}}
info: Client User-Agent string: Python-urllib/2.7
info: [debug] Didn’t get app but did get Android package, will attempt to launch it on the device
info: [debug] Creating new appium session 9272ccbd-3ccb-47ec-9503-877f7c57995c
info: Starting android appium
info: [debug] Getting Java version
info: Java version is: 1.8.0_91
info: [debug] Checking whether adb is present
info: [debug] Using adb from D:\appium\android-sdk_r23.0.2-windows\android-sdk-windows\platform-tools\adb.exe
warn: No app capability, can’t parse package/activity
info: [debug] Using fast reset? true
info: [debug] Preparing device for session
info: [debug] Not checking whether app is present since we are assuming it’s already on the device
info: [debug] Trying to find Android4.4.2_test emulator
info: [debug] Getting connected emulators
info: [debug] Getting connected devices…
info: [debug] executing cmd: D:\appium\android-sdk_r23.0.2-windows\android-sdk-windows\platform-tools\adb.exe devices
info: [debug] 1 device(s) connected
info: [debug] 1 emulator(s) connected
info: [debug] Sending telnet command to device: avd name
info: [debug] Getting running emulator port
info: [debug] Socket connection to device created
info: [debug] Socket connection to device ready
info: [debug] Telnet command got response: ae[Ke[Dave[Ke[De[Davde[Ke[De[De[Davd e[Ke[De[De[De[Davd ne[Ke[De[De[De[De[Davd nae[Ke[De[De[De[De[De[Davd name[Ke[De[De[De[De[De[De[Davd namee[K
Android4.4.2_test
info: [debug] Emulator Android4.4.2_test not running
info: [debug] Launching Emulator with AVD Android4.4.2_test, launchTimeout 120000ms and readyTimeout 120000ms
info: [debug] Checking whether emulator is present
info: [debug] Using emulator from D:\appium\android-sdk_r23.0.2-windows\android-sdk-windows\tools\emulator.exe
info: [debug] Trying to find Android4.4.2_test emulator
info: [debug] Getting connected emulators
info: [debug] Getting connected devices…
info: [debug] executing cmd: D:\appium\android-sdk_r23.0.2-windows\android-sdk-windows\platform-tools\adb.exe devices
info: [debug] 1 device(s) connected
info: [debug] 1 emulator(s) connected
info: [debug] Sending telnet command to device: avd name
info: [debug] Getting running emulator port
info: [debug] Socket connection to device created
info: [debug] Socket connection to device ready
info: [debug] Telnet command got response: ae[Ke[Dave[Ke[De[Davde[Ke[De[De[Davd e[Ke[De[De[De[Davd ne[Ke[De[De[De[De[Davd nae[Ke[De[De[De[De[De[Davd name[Ke[De[De[De[De[De[De[Davd namee[K
Android4.4.2_test
info: [debug] Emulator Android4.4.2_test not running
info: [debug] Trying to find Android4.4.2_test emulator
info: [debug] Getting connected emulators
info: [debug] Getting connected devices…
info: [debug] executing cmd: D:\appium\android-sdk_r23.0.2-windows\android-sdk-windows\platform-tools\adb.exe devices
info: [debug] 1 device(s) connected
info: [debug] 1 emulator(s) connected
info: [debug] Sending telnet command to device: avd name
info: [debug] Getting running emulator port
info: [debug] Socket connection to device created
info: [debug] Socket connection to device ready
info: [debug] Telnet command got response: ae[Ke[Dave[Ke[De[Davde[Ke[De[De[Davd e[Ke[De[De[De[Davd ne[Ke[De[De[De[De[Davd nae[Ke[De[De[De[De[De[Davd name[Ke[De[De[De[De[De[De[Davd namee[K
Android4.4.2_test
info: [debug] Emulator Android4.4.2_test not running
info: [debug] Trying to find Android4.4.2_test emulator
info: [debug] Getting connected emulators
info: [debug] Getting connected devices…
info: [debug] executing cmd: D:\appium\android-sdk_r23.0.2-windows\android-sdk-windows\platform-tools\adb.exe devices
info: [debug] 1 device(s) connected
info: [debug] 1 emulator(s) connected
info: [debug] Sending telnet command to device: avd name
info: [debug] Getting running emulator port
info: [debug] Socket connection to device created
info: [debug] Socket connection to device ready
info: [debug] Telnet command got response: ae[Ke[Dave[Ke[De[Davde[Ke[De[De[Davd e[Ke[De[De[De[Davd ne[Ke[De[De[De[De[Davd nae[Ke[De[De[De[De[De[Davd name[Ke[De[De[De[De[De[De[Davd namee[K
Android4.4.2_test
info: [debug] Emulator Android4.4.2_test not running
error: Unable to start Emulator: qemu-system-i386.exe:
error: Unable to start Emulator: -drive if=none,index=1,id=cache,file=C:\Users\siwang.android\avd\Android4.4.2_test.avd/cache.img: could not open disk image C:\Users\siwang.android\avd\Android4.4.2_test.avd/cache.img: Could not open ‘C:\Users\siwang.android\avd\Android4.4.2_test.avd/cache.img’: Invalid argument

info: [debug] Trying to find Android4.4.2_test emulator
info: [debug] Getting connected emulators
info: [debug] Getting connected devices…
info: [debug] executing cmd: D:\appium\android-sdk_r23.0.2-windows\android-sdk-windows\platform-tools\adb.exe devices
info: [debug] 1 device(s) connected
info: [debug] 1 emulator(s) connected
info: [debug] Sending telnet command to device: avd name
info: [debug] Getting running emulator port
info: [debug] Socket connection to device created
info: [debug] Socket connection to device ready
info: [debug] Telnet command got response: ae[Ke[Dave[Ke[De[Davde[Ke[De[De[Davd e[Ke[De[De[De[Davd ne[Ke[De[De[De[De[Davd nae[Ke[De[De[De[De[De[Davd name[Ke[De[De[De[De[De[De[Davd namee[K
Android4.4.2_test
info: [debug] Emulator Android4.4.2_test not running
info: [debug] Trying to find Android4.4.2_test emulator
info: [debug] Getting connected emulators
info: [debug] Getting connected devices…
info: [debug] executing cmd: D:\appium\android-sdk_r23.0.2-windows\android-sdk-windows\platform-tools\adb.exe devices
info: [debug] 1 device(s) connected
info: [debug] 1 emulator(s) connected
info: [debug] Sending telnet command to device: avd name
info: [debug] Getting running emulator port
info: [debug] Socket connection to device created
info: [debug] Socket connection to device ready
info: [debug] Telnet command got response: ae[Ke[Dave[Ke[De[Davde[Ke[De[De[Davd e[Ke[De[De[De[Davd ne[Ke[De[De[De[De[Davd nae[Ke[De[De[De[De[De[Davd name[Ke[De[De[De[De[De[De[Davd namee[K
Android4.4.2_test
info: [debug] Emulator Android4.4.2_test not running
info: [debug] Trying to find Android4.4.2_test emulator
info: [debug] Getting connected emulators
info: [debug] Getting connected devices…
info: [debug] executing cmd: D:\appium\android-sdk_r23.0.2-windows\android-sdk-windows\platform-tools\adb.exe devices
info: [debug] 1 device(s) connected
info: [debug] 1 emulator(s) connected
info: [debug] Sending telnet command to device: avd name
info: [debug] Getting running emulator port
info: [debug] Socket connection to device created
info: [debug] Socket connection to device ready
info: [debug] Telnet command got response: ae[Ke[Dave[Ke[De[Davde[Ke[De[De[Davd e[Ke[De[De[De[Davd ne[Ke[De[De[De[De[Davd nae[Ke[De[De[De[De[De[Davd name[Ke[De[De[De[De[De[De[Davd namee[K
Android4.4.2_test
info: [debug] Emulator Android4.4.2_test not running
info: [debug] Trying to find Android4.4.2_test emulator
info: [debug] Getting connected emulators
info: [debug] Getting connected devices…
info: [debug] executing cmd: D:\appium\android-sdk_r23.0.2-windows\android-sdk-windows\platform-tools\adb.exe devices
info: [debug] 1 device(s) connected
info: [debug] 1 emulator(s) connected
info: [debug] Sending telnet command to device: avd name
info: [debug] Getting running emulator port
info: [debug] Socket connection to device created
info: [debug] Socket connection to device ready
info: [debug] Telnet command got response: ae[Ke[Dave[Ke[De[Davde[Ke[De[De[Davd e[Ke[De[De[De[Davd ne[Ke[De[De[De[De[Davd nae[Ke[De[De[De[De[De[Davd name[Ke[De[De[De[De[De[De[Davd namee[K
Android4.4.2_test
info: [debug] Emulator Android4.4.2_test not running
info: [debug] Trying to find Android4.4.2_test emulator
info: [debug] Getting connected emulators
info: [debug] Getting connected devices…
info: [debug] executing cmd: D:\appium\android-sdk_r23.0.2-windows\android-sdk-windows\platform-tools\adb.exe devices
info: [debug] 1 device(s) connected
info: [debug] 1 emulator(s) connected
info: [debug] Sending telnet command to device: avd name
info: [debug] Getting running emulator port
info: [debug] Socket connection to device created
info: [debug] Socket connection to device ready
info: [debug] Telnet command got response: ae[Ke[Dave[Ke[De[Davde[Ke[De[De[Davd e[Ke[De[De[De[Davd ne[Ke[De[De[De[De[Davd nae[Ke[De[De[De[De[De[Davd name[Ke[De[De[De[De[De[De[Davd namee[K
Android4.4.2_test
info: [debug] Emulator Android4.4.2_test not running
Killed Node Server.
Appium server process ended

A similar issue is logged here Appium - Emulator not running error but no replies in it so far.

Similar problem on Linux platform…In my case there is a “qemu-system-i386” process remaining after the last Appium execution. If I kill the process, the appium could start again.