17

When I click the 'run as Android application' option, it shows the following error:

[2010-08-16 16:56:35 - Emulator] invalid command-line parameter: http://hostname:port.
[2010-08-16 16:56:35 - Emulator] Hint: use '@foo' to launch a virtual device named 'foo'.
[2010-08-16 16:56:35 - Emulator] please use -help for more information
Yi Jiang
  • 49,435
  • 16
  • 136
  • 136
Kandha
  • 3,659
  • 12
  • 35
  • 50
  • 1
    A bit more details would be appreciated. Did you create a custom emulator? did you add command lines to be launched when your emulator starts? – Sephy Aug 16 '10 at 12:33
  • 1
    no i am not created the custom emulator and not add command lines i think it's happening from my previous virtual device – Kandha Aug 16 '10 at 12:42
  • did you solve this problem? if so please share the answer. If not please share the details of what the application does etc so we can find a solution – lalli Sep 03 '10 at 11:24
  • 1
    my problem has been solved...i deleted my virtual device from eclipse and delete the temporary folder from c:\documents and settings\user\.android\avd then created new device..it was working fine now – Kandha Sep 03 '10 at 12:25
  • Kandhu, if your question has been answered, please select the correct answer. – ardavis Jul 20 '11 at 22:32

10 Answers10

31

Apparently the problem are the spaces in the path, so just from:

C:\Program Files\Android\android-sdk

to: C:\PROGRA~1\Android\android-sdk

If you have a 64 bit system

From: C:\Program Files (x86)\Android\android-sdk to:

C:\PROGRA~2\Android\android-sdk

Under Windows->Preferences->Android Change the SDK Location as shown above.

Translated from: http://satoriwd.com/astath/?p=11

user914425
  • 16,303
  • 4
  • 30
  • 41
  • 1
    In Eclipse, edit the preferences of the ADT plugin. Change the location of the Android SDK as described in this answer. – Bart Aug 18 '11 at 21:05
  • Thanks porfiro and @Bart. I was just about to toss my laptop accross the room!! :) – Dylan Jackson Aug 28 '11 at 10:45
8

I've been trying to solve this same problem for two days now, and I just found a solution which works for me:

Cut the 'Android' file folder from it's place in the 'Program Files' (or 'Program Files (x86)' if you use Windows 7) folder and paste it directly in the C:\ directory

Your SDK file path should look like this:

C:\Android\android-sdk

Simple as that :D Now the Android debugger shouldn't worry about there being a space in the file path. Let me know if additional clarification is needed

1

If you manually open the emulator from within the Android SDK then run the debugger it works too.

JDM
  • 11
  • 1
1

I was facing the same problem with Android when executing the emulator, and I found a solution right now. Please follow these steps:

  1. Uninstall the SDK that you have already installed
  2. Create a folder in disc C
  3. Name it like Android
  4. Open it and create inside it a new folder, for me I named it PROGRA~1
  5. Execute the installation of your SDK to be installed in the folder created PROGRA~1
Yi Jiang
  • 49,435
  • 16
  • 136
  • 136
user853761
  • 11
  • 1
1

In the line that says invalid parameter. You need to get rid of all the spaces. I had the same problem - my path was something like jason/phone app/xyz

I changed the directory name to jason/phoneapp/xyz and it worked. You need to change the actual name of the directory that the command line is referencing. Then you need to go into eclipse and go into Windows > Preferences and you will find it says phone app (in my case) and change this also to phoneapp, and all will be well.

Don't uninstall anything, and don't move files around because they will the rest of the SDK will eventually go looking for them and not be able to find them.

Yi Jiang
  • 49,435
  • 16
  • 136
  • 136
jason
  • 11
  • 1
1

i did the following and my problem was solved(MY PROBLEM:when i wanted to run an emulator from the AVD manager,i received the following error "invalid command-line parameter: Files. Hint: use '@foo' to launch a virtual device named 'foo'. please use -help for more information") i think its happens when in the path of android.exe (in the tools folder in android-sdk directory) any space exists (like C:/Program Files(x86)/... between Program and Files) So what did i do? -i deleted all virtual devices that have created. -copied the whole android-sdk folder somewhere else. -uninstalled and reinstalled SDK in another path without any spaces(like C:/Android/android-sdk) -i copied the contents of old sdk-android (which was copied before uninstalling) like platform tools and platforms folders to the new path.(you can download platform tools and platform(s) again from the avd manager but this waist time) it worked for me and i hope it works for you too. thanks

Peyman
  • 11
  • 1
1

I had this same exact error when I would try to launch the emulator from Eclipse. I had all my Android files in my documents to begin with, not my program files. I moved these files and still had the problem because of my user name having a space in it.

So I took the suggestion of Andrew McGarry and put my Android SDK folder in my C: directory and viola, problem solved...well after I redirected it in Eclipse obviously lol.

Just make sure that nothing in your SDK path has a space in it and you should be fine. You shouldn't have to uninstall or delete anything, and you probably won't have to move any files around either. Remember...no spaces in the entire path. =)

0

This trick doesn't work in IntelliJ. To solve it I moved the Android SDK to c:\android-sdk-windows.

After that you still have to change the path to Android in IntelliJ of course: - right click on the module -> open module settings - go to: platform settings -> SDKs -> Android

Or delete the previous one and create a new one

lukin
  • 471
  • 1
  • 4
  • 12
0

I've been trying to solve this same problem,and I just found a solution which works for me: @First i saw a file named adb_has_moved.txt.The contents of the file were "The adb tool has moved to platform-tools/

If you don't see this directory in your SDK, launch the SDK and AVD Manager (execute the android tool) and install "Android SDK Platform-tools"

Please also update your PATH environment variable to include the platform-tools/ directory, so you can execute adb from any location.

" so i copied adb.exe from platform-tools to tools......BUT THAT DIDN'T WORKED OUT Then i tried the next solution that is to create a new device bt that also flopped removing old virtual devices and creating new one was also not working for me

SO i tried the solution below and stated by many.i found it from a spanish blog.i dont knw spanish bt i do knw google translate.

It seems the problem is the spaces in the path for example:C:\Program Files\Android\android-sdk

CHANGE THIS TO C:\PROGRA~1\Android\android-sdk

It really worked out for me.

vatsal
  • 309
  • 1
  • 5
  • 13
-1

Delete your previous Virtual devices. Re create it. launch it.

Once the emulator is running, run your application.

Other wise, go to your run configuration and select the emulator you would like to run.

Vinay
  • 2,395
  • 3
  • 30
  • 35