Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-10072] Android: CLI won't launch Android Emulator

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2013-01-24T03:36:42.000+0000
Affected Version/sRelease 2.1.1, Release 2.1.2, Release 2.1.3, Release 2.1.4, Release 3.0.0
Fix Version/sRelease 3.0.1, Release 3.1.0, 2012 Sprint 24, 2012 Sprint 24 JS
ComponentsCLI
Labelscore, emulator, qe-testadded, triage
ReporterChaim Krause
AssigneeChris Barber
Created2012-07-13T11:01:56.000+0000
Updated2013-10-03T07:19:24.000+0000

Description

Problem description

Trying to launch the emulator using 'titanium emulator' in console fails. 1) --platform is listed as an optional parameter for emulator, but it is required. 2) When --platform=android is used, the command fails and the emulator is not run.

Steps to reproduce

From the console, run (in a project directory):
$ titanium emulator
required argument '--platform' missing

$ titanium emulator --platform=android
Invalid platform type: android

Additional note

Customer gets a different error:
$ titanium emulator --platform=android
Traceback (most recent call last):
File "/Users/chaim/Library/Application Support/Titanium/mobilesdk/osx/2.0.2.GA/android/builder.py", line 2081, in <module>
tiappxml = TiAppXML(os.path.join(project_dir, 'tiapp.xml'))
File "/Users/chaim/Library/Application Support/Titanium/mobilesdk/osx/2.0.2.GA/tiapp.py", line 52, in __init__
data = codecs.open(self.file,'r','utf-8','replace')
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/codecs.py", line 881, in open
file = __builtin__.open(filename, mode, buffering)
IOError: [Errno 2] No such file or directory: 'android/tiapp.xml'

Comments

  1. Neeraj Gupta 2012-07-23

    We need complete environment to diagnose this issue.
  2. Paul Mietz Egli 2012-08-03

    This is also happening for me in a standard install of 2.1.1.GA. In android/builder.py, the arguments being passed to \_\_main\_\_ are:
       0: /Users/paul/Library/Application Support/Titanium/mobilesdk/osx/2.1.1.GA/android/builder.py
       1: run-emulator
       2: android
       3: /Users/paul/Documents/pegli/ti/modules/ti_touchdb/samples/TouchBooks (path to my project)
       
    The "android" at position 2 comes from --platform=android. I didn't have time to track down why the wrong arguments are being sent to the builder script, so I modified my build.py at lines 2170-2171 to read:
       project_dir = sys.argv[3]
       sdk_dir = os.environ['ANDROID_SDK']
       
    This seems to do the trick for me.
  3. Paul Mietz Egli 2012-10-04

    Still happening in 2.1.3.GA; workaround still applies. New lines to replace are 2218-2219.
  4. Olivier Lalonde 2012-11-08

    Same problem here. Titanium CLI is totally unusable because of this.
  5. Olivier Lalonde 2012-11-08

    dupe
  6. Tamila Smolich 2012-11-08

    Able to reproduce this issue with the same error as in description. Testing environment: Mac OS X Lion 10.7.5 Titanium SDK, builds: 2.1.2.GA 2.1.3.GA 2.1.4.v20121030173408 3.0.0.v20121005014113
  7. Dustin Hyde 2012-11-08

    Note that Titanium Studio makes this call, which is successful:
       "/usr/bin/python" "/Users/dhyde/Library/Application Support/Titanium/mobilesdk/osx/3.0.0.v20121107151610/android/builder.py" "emulator" "Project" "/Users/dhyde/Desktop/android/android-sdk-macosx" "/Users/dhyde/Desktop/TISTUD-RC/workspace/Project" "com.appcelerator.project" "4" "WVGA854" "armeabi" ""
       
  8. Dustin Hyde 2012-11-08

    Also note the documentation: https://wiki.appcelerator.org/display/guides2/Legacy+Command-Line+Interface Run a project on the Android Emulator: 'titanium.py run --platform=android'
  9. Chris Barber 2012-11-21

    Master pull request: https://github.com/appcelerator/titanium_mobile/pull/3453 3.0.x pull request: https://github.com/appcelerator/titanium_mobile/pull/3454
  10. Shyam Bhadauria 2013-01-17

    Android emulator is being launched now through CLI. Environment used for verification - Titanium SDK: 3.1.0.v20130114171802 Titanium  Studio:3.0.1.201212181159

JSON Source