Android Emulator - invalid command-line parameter:

烈酒焚心 提交于 2019-12-04 19:23:13

问题


When I try to launch my Android Virtual Device, I get the following error.

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

I have been using the emulator for months, and I just downloaded new updates from SDK/AVD Manager.


回答1:


This problem is caused by blank spaces in the path you setup in the Android SDK. The solution is that you should move the folder of the Android SDK to a place without spaces, in your case:

E:\andriod-sdk-windows 

or

D:\abc\xyz\android-sdk-windows



回答2:


Please refer to the Stack Overflow post Starting the Android emulator in SDK tools, revision 12 for a solution. It did not come up in the search, but it did correct my problem. The space in the path name (PROGRAM FILES) seems to be causing the problem. I took the renaming suggestion to change the path name to PROGRA~1, and my problem was resolved.




回答3:


It looks like someone already reported this problem, Issue 18317: Emulator in R12 doesn't properly invoke emulator-arm.exe if the install path as a space in it

... to summarize:

  • Yes, there will be a fix. We're working on it.

  • The primary workaround is install in a path with no spaces, e.g. c:\android.

  • If that's not a choice, the second workaround right now is to use the "short path" Windows notation, e.g. "C:\PROGRA~1" either on command lines or in the Eclipse preferences. Remember that the number might change depending on your directories; you can use "dir /X c:\" in cmd.exe to see the exact short path for a given directory.

We'll have to wait for their fix but in the meantime we can just remove the spaces in the Android installation directory.




回答4:


In Eclipse go to Windows -> Preferences -> Android and in your SDK location replace C:\Program Files\android-sdk-windows with C:\PROGRA~1\android-sdk-windows




回答5:


If you want to run the emulator only without eclipse you'll need to create a .bat file with the SDK short path:

for 32 bits machines: C:\PROGRA~1\Android\android-sdk\SDK Manager.exe

for 64 bits machines: C:\PROGRA~2\Android\android-sdk\SDK Manager.exe



来源:https://stackoverflow.com/questions/6629273/android-emulator-invalid-command-line-parameter

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!