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

You must Login before you can answer or comment on any questions.

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 2 years ago by Justin Toth
4 Comments
  • I'm also having this exact same problem and would love a solution!

    — commented 2 years ago by Topher Fangio

  • Have you tried rebuilding the project completely aftervremovingvthe android build directory? That should cause the avd to be created

    — commented 2 years ago 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 2 years ago by Don Thorp

  • Show 1 more comment

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 2 years ago by Justin Toth
answer permalink
3 Comments
  • Thanks for spelling this out for folks.

    — commented 2 years ago by Don Thorp

  • Thanks for spelling this out for folks.

    — commented 2 years ago 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 6 months ago 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 2 years ago by James Adams
answer 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 2 years ago by Don Thorp

  • Easy solution, thanks! You might want to add this to the Getting Started docs.

    — commented 2 years ago by Josh Knight

Your Answer

Think you can help? Login to answer this question!