Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Starting the Android emulator in SDK tools, revision 12

I updated the Android SDK tools from revision 11 to revision 12, and the emulator now fails to start. When I try to run emulator.exe, I get:

invalid command-line parameter: Files\Android\android-sdk\tools/emulator-arm.exe.
Hint: use '@foo' to launch a virtual device named 'foo'.
please use -help for more information

The path to emulator.exe is C:\Program Files\Android\android-sdk\tools.

How do I fix it?

like image 370
Timothy003 Avatar asked Jul 06 '11 21:07

Timothy003


People also ask

How do I open Android SDK tools?

To open the SDK Manager from Android Studio, click Tools > SDK Manager or click SDK Manager in the toolbar. If you're not using Android Studio, you can download tools using the sdkmanager command-line tool. When an update is available for a package you already have, a dash appears in the check box next to the package.

What is Android SDK emulator?

The Android SDK includes a virtual mobile device emulator that runs on your computer. The emulator lets you prototype, develop and test Android applications without using a physical device.

How do I manually run an Android Emulator?

However, you can install the application manually using command adb install <path-to-your-APK> . Now switch to emulator and launch your application like on any normal device, through the launcher. Or, as an alternative, you can use the following command: adb shell am start -a android.


2 Answers

As was previously suggested, it does seem to be caused by the fact that there is a space in the default installation path of the Android SDK: C:\Program Files\Android\android-sdk\

There are a couple of possible solves, though-

  1. move installation directories to paths that do not contains spaces (as already mentioned)...
  2. but simpler and possibly slightly less cumbersome is simply adjusting the path in Eclipse to use 8-dot-3 directory name(s). Since I'm running Win7, I have two Program Files directories, the second one being "Program Files (x86)" which is where the sdk installed. So the 8-dot-3 path is PROGRA~2. Thus, I simply changed the "SDK Location" value in the Android Preferences in Eclipse from C:\Program Files\Android\android-sdk\ to C:\PROGRA~2\Android\android-sdk\ and everything now works fine.

If you don't know the 8-dot-3 name of your desired path, just fire up a Command Prompt and execute "DIR /X"... the short name will be displayed next to each directory.

like image 90
Carl S Avatar answered Sep 16 '22 17:09

Carl S


Same problem for me, though this is my first time trying to work with Android SDK in general. I believe the problem is with the location of the SDK. Note the "paramater" "Files\Android\android-sdk\tools/emulator-arm.exe." I believe there is a bug in google's code where it doesn't have the directory the SDK is located in in quotes, meaning, if there is a space anywhere in the directory name, it won't work. Can someone with their SDK in a directory with no spaces confirm my theory?

To work around the issue, you can call "C:\Program Files\Android\android-sdk\tools\emulator @foo" from the command line, where "foo" is the name of your emulator.

like image 34
Highsight Avatar answered Sep 20 '22 17:09

Highsight