Description:
Since Google released r13 tooling which includes a fix for the "space in the path" issue introduced with r12, we updated our XP and Win 7 test systems to the new SDK. Attempting to launch the emulator with studio fails with the following console output:
[DEBUG] SDCard: C:\Users\Joe Tester\.titanium\android2.sdcard
[DEBUG] AVD ID: 21
[DEBUG] AVD Skin: WVGA800
[DEBUG] SDK: C:\android-sdk
[DEBUG] C:\android-sdk\platform-tools\adb.exe start-server
[INFO] Creating 64M SD card for use in Android emulator
[DEBUG] C:\android-sdk\tools\mksdcard.exe 64M "C:\Users\Joe Tester\.titanium\titanium_21_WVGA800.sdcard"
[INFO] Creating new Android Virtual Device (21 WVGA800)
[DEBUG] C:\android-sdk\tools\emulator.exe -avd titanium_21_WVGA800 -port 5560 -sdcard C:\Users\Joe Tester\.titanium\titanium_21_WVGA800.sdcard -logcat *:d,* -no-boot-anim -partition-size 128
invalid command-line parameter: Tester\.titanium\titanium_21_WVGA800.sdcard.
Hint: use '@foo' to launch a virtual device named 'foo'.
please use -help for more information
[DEBUG] signal caught: 3
[DEBUG] calling emulator kill on 2544
ERROR: The process "2544" not found.
As you can see, the text after the space is treated as an invalid parameter. We were hoping the change to the Android SDK would resolve this problem, but it doesn't seem to have made a difference.
Steps to reproduce:
Install Android SDK r13 on Windows 7 or XP
Ensure your user account has a space in the Name on Win 7
#* If on XP, the path should include "Documents and Settings" regardless of user account
Create a new project in Titanium Studio
Attempt to run the project in the emulator
Result:
Emulator fails to launch
Expected:
Emulator launches
This is an Android SDK issue, documented as [Issue 18317: Emulator in R12 doesn't properly invoke emulator-arm.exe if the install path or any parameter has a space in it](https://code.google.com/p/android/issues/detail?id=18317). Workaround is to use windows short 8dot3 filenames, for example: || Real Path || Path using 8dot3 names || | C:\Program Files | C:\PROGRA~1\ | | C:\Program Files (x86)\ | C:\PROGRA~2\ | | C:\Users\Joe Tester\ | C:\Users\JOETES~1 | To test these, copy and paste one into the Start button > "Run" / "Search programs and files" box. To find 8dot3 names, at the command prompt run:
Please also see this related discussion: [Titanium install on Windows XP SP3 gives me a serious headache](http://developer.appcelerator.com/devlink/profile/473051/paul-dowsett)
This is being caused by the form of line 420 in builder.py. The location of the SDcard for the emulator is placed in "Documents and settings" by default. Currently it is:
When set to the following, it works. The impact of changing this for other platforms is unknown.
[This thread](http://developer.appcelerator.com/question/124530/how-do-i-manually-set-the-sdcard-path-for-the-android-emulator-error-invalid-command-line-parameter-and) supports Eric's solution.
Functional test results below show that ayeung's fix works as expected on Windows 7:
Note, this has not been tested on osx or ubuntu.
Reopening. While existing emulators previously created are working, new emulators can't be created with Win7, will verify on XP. This occurs with SDK: 1.8.0.1.v20111220190134.
When cleaning out all existing emulators and then trying to use studio to create a new one, this is returned on XP: [ERROR] Could not create file '"C:\Documents and Settings\Administrator\.titanium\titanium_26_WVGA854.sdcard"': Invalid argument Error: '"C:\Documents and Settings\Administrator\.titanium\titanium_26_WVGA854.sdcard"' is not recognized as a valid sdcard value. Value should be: 1. path to an sdcard. 2. size of the sdcard to create:
Closing ticket as fixed.