Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

Can't get android simulator to run through titanium on OSX

I was able to get the android simulator to run fine on Windows 7 however in Snow Leopard it won't run through Titanium. I checked the android sdk manager and it shows no avd's created by Titanium. I created my own avn manually and it runs fine in the simulator.

Titanium is blowing up when trying to open the adb process in androidsdk.py:166 via subprocess.py:

(out, err) = subprocess.Popen([adb, 'devices'], stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()

This would typically mean that Titanium can't find the android sdk path correctly, however I have it set in edit profile to /opt/android-sdk/ and that is where the root of the sdk is. I can see the adb executable in /opt/android-sdk/platform-tools/.

The other thing that this error means sometimes is that the jdk isn't installed but it comes preinstalled on Snow Leopard and I've run "javac -version" and confirmed that it's installed.

The error given in Titanium is:

[INFO] Launching Android emulator...one moment
[DEBUG] From: /opt/android-sdk/tools/emulator
[DEBUG] SDCard: /Users/justin/.titanium/android2.sdcard
[DEBUG] AVD ID: 2
[DEBUG] AVD Skin: WVGA854
[DEBUG] SDK: /opt/android-sdk
[TRACE] Traceback (most recent call last):
[TRACE] File "/Library/Application Support/Titanium/mobilesdk/osx/1.4.2/android/builder.py", line 991, in <module>
[TRACE] s.run_emulator(avd_id,avd_skin)
[TRACE] File "/Library/Application Support/Titanium/mobilesdk/osx/1.4.2/android/builder.py", line 246, in run_emulator
[TRACE] devices = self.sdk.list_devices()
[TRACE] File "/Library/Application Support/Titanium/mobilesdk/osx/1.4.2/android/androidsdk.py", line 166, in list_devices
[TRACE] (out, err) = subprocess.Popen([adb, 'devices'], stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()
[TRACE] File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/subprocess.py", line 595, in __init__
[TRACE] errread, errwrite)
[TRACE] File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/subprocess.py", line 1106, in _execute_child
[TRACE] raise child_exception
[TRACE] OSError: [Errno 2] No such file or directory
[INFO] Building Navtrak for Android ... one moment
[DEBUG] Waiting for device to be ready ...
[TRACE] Traceback (most recent call last):
[TRACE] File "/Library/Application Support/Titanium/mobilesdk/osx/1.4.2/android/builder.py", line 995, in <module>
[TRACE] s.build_and_run(False,avd_id)
[TRACE] File "/Library/Application Support/Titanium/mobilesdk/osx/1.4.2/android/builder.py", line 768, in build_and_run
[TRACE] self.wait_for_device('e')
[TRACE] File "/Library/Application Support/Titanium/mobilesdk/osx/1.4.2/android/builder.py", line 166, in wait_for_device
[TRACE] devices = self.sdk.list_devices()
[TRACE] File "/Library/Application Support/Titanium/mobilesdk/osx/1.4.2/android/androidsdk.py", line 166, in list_devices
[TRACE] (out, err) = subprocess.Popen([adb, 'devices'], stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()
[TRACE] File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/subprocess.py", line 595, in __init__
[TRACE] errread, errwrite)
[TRACE] File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/subprocess.py", line 1106, in _execute_child
[TRACE] raise child_exception
[TRACE] OSError: [Errno 2] No such file or directory

Any help would be greatly appreciated, I've spent an entire day trying to get this working and don't have anything else to try…

— asked December 6th 2010 by Justin Toth
  • android
  • osx
4 Comments
  • I'm also having this exact same problem and would love a solution!

    — commented December 6th 2010 by Topher Fangio
  • Have you tried rebuilding the project completely aftervremovingvthe android build directory? That should cause the avd to be created

    — commented December 6th 2010 by Aaron Saunders
  • Are you using the new Android SDK just released today? We're seeing that error as well and we're trying to provide a solution for it. You need to go back to a previous version of the tooling if you are indeed running the lastest ADK.

    — commented December 6th 2010 by Don Thorp
  • Yes I have tried building the project completely after removing the android build directly and it still doesn't generate an avd.

    I'm not running the android sdk APIs 2.3 if that's what you're referring to, I've tried using APIs 1.6 and 2.2 but neither worked.

    Some others posted in the thread below with the same issue and so I posted there as well:

    http://developer.appcelerator.com/question/86411/android-build-fails-silently#header

    It's probably easiest if you ignore this thread and just provide the answer there if one is found. It's interesting that this just popped up today and that the titanium version doesn't change the outcome, something funky going on with the android sdk…

    — commented December 7th 2010 by Justin Toth

2 Answers

  • Accepted Answer

    From another post where others were having the same issue:

    In your android-sdk root there are "platform-tools" and "tools" directories. By default, the adb executable is located in "platform-tools" but Titanium seems to be looking for it in "tools" (where it used to be?) So all you have to do is copy/paste the adb executable to "tools" and then the simulator loads right up.

    — answered December 7th 2010 by Justin Toth
    permalink
    3 Comments
    • Thanks for spelling this out for folks.

      — commented December 7th 2010 by Don Thorp
    • Thanks for spelling this out for folks.

      — commented December 7th 2010 by Don Thorp
    • Tried a fresh install of titanium and android sdk (via titanium) on both mountain lion and snow leopard *10.8 and 10.6 respectively). Results: Mountain Lion, no problem. Snow Leopared, had this error and this fix worked for me. Instead of copying the binary though, I created an alias for it like this from within the tools directory (without quotes): "ln -s ../platform-tools/adb adb"

      — commented December 13th 2012 by Andrew Blair
  • Maybe you should add this to the documentation as its been a thorn in my side for 3 three days and this is the only reference to such a huge problem for you Windows client.

    — answered December 8th 2010 by James Adams
    permalink
    2 Comments
    • It happened on Monday morning when Google broke everything for us. It's Wed morning. We had it diagnosed, fixed and started communicating the workaround in < 24 hours and the community is also helping get the word out.

      — commented December 8th 2010 by Don Thorp
    • Easy solution, thanks! You might want to add this to the Getting Started docs.

      — commented December 14th 2010 by Josh Knight
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.