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…
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.
-
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.