Question

Attempting to just start up Appium with an emulator using an example program.

Output:

debug: executing: "C:\Program Files (x86)\Android\android-studio\sdk\platform-tools\adb.exe" -s emulator-5554 install C:\Program Files\Appium\node_modules\appium\build\unlock_apk\unlock_apk-debug.apk
warn:  killed=false, code=1, signal=null
info: Stopping logcat capture
info: Sent shutdown command, waiting for UiAutomator to stop...
warn: UiAutomator did not shut down fast enough, calling it gone
info: Cleaning up android objects
info: Cleaning up appium session
error: Failed to start an Appium session, err was: Error: Command failed: can't find 'C:\Program' to install

info: Responding to client with error: {"status":33,"value":{"message":"A new session could not be created. (Original error: Command failed: can't find 'C:\\Program' to install\r\n)","killed":false,"code":1,"signal":null,"origValue":"Command failed: can't find 'C:\\Program' to install\r\n"},"sessionId":null}
POST /wd/hub/session 500 11733ms - 316b

Tried with an emulator with the apk already installed and a fresh emulator, get the same result.

code:

DesiredCapabilities caps = new DesiredCapabilities();
    caps.SetCapability("device", "Android");
    caps.SetCapability("browserName", "");
    caps.SetCapability("app-activity", "MainActivity");
    caps.SetCapability(CapabilityType.Version, "4.2");
    caps.SetCapability("app-package", "com.example.android.interactivechart");
    caps.SetCapability("app", @"C:\scm\InteractiveChart\out\production\InteractiveChart\InteractiveChart.apk");

RemoteWebDriver driver = new RemoteWebDriver(new Uri("http://127.0.0.1:4723/wd/hub"), caps, new TimeSpan(0,5,0)); //error here

Anyone know why it's doing this? I've had a look around and I can't find anything. It's probably something simple but the 'C:\Program' is throwing me since I don't pass in anything containing this.

Edit: added windows tag as the default install locations were the source of the issue

Was it helpful?

Solution

I don't know anything about Appium but it seems like it has a problem with the directory name,The directory should not have a space while using some command line tools,move the Android sdk and Appium folders to a directory with no spaces (like to C:) and try the command with that directory.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top