The Problem
It's possible for a Genymotion emulator's IP address property to not be properly removed when the Genymotion emulator is shutdown. The Titanium CLI expects that the IP address will only be listed if the Genymotion emulator is running. When it sees the IP address, it will try to connect to the Genymotion emulator and check if it has Google APIs installed and an error occurs.
The root problem is the error is not properly handled and causes the build/info command to crash or spin indefinitely.
The Workaround
Shutdown all Genymotion emulators. From the command line, run:
vboxmanage list vms
For each VM, copy the uuid and past it into the following:
vboxmanage guestproperty enumerate <uuid>
Look for the
androvm_ip_management
property. If it exists, remove it:
vboxmanage guestproperty delete <uuid> androvm_ip_management
The Proper Fix
To fix this issue the right way, the Genymotion library needs to handle error messages when the adb shell command fails while attempting to detect the presence of Google APIs.
I am seeing this when trying to run on an Android device as well
Master: https://github.com/appcelerator/titanium_mobile/pull/5912 3_3_X: https://github.com/appcelerator/titanium_mobile/pull/5913 To test, you need to mimic a stale Genymotion IP address. The easiest way to do this is:
Pick a UUID, then paste it into:
Then perform a build:
NOTE: you will probably want to temporarily move or permanently delete all AVDs (~/.android/avd) and all Genymotion emulators EXCEPT a single Genymotion emulator which you'll use above.
[~bgrantges] Would you mind applying the small changes from one of the PRs above directly to your 3.3.0.GA SDK code and see if that solves the problem? Thanks!
Following the steps outlined by Chris, the app is built, the Genymotion emulator is launched, and the app installed/run as expected
[~cbarber] I tried both the work around and patching the SDK. Unfortunately now i can not detect my Android devices at all - nor genymotion! Here was the last console message i received prior to applying the patches etc. https://gist.github.com/grantges/c90c1382c26cd79331f6 After applying the patch, and performing a ti info (after which my devices no longer were detected by CLI or Studio) i output the following
ti info
andadb devices
https://gist.github.com/grantges/1b95e8993f4a95fb656dBert, in your second Gist, I see an Android emulator (look for Android AVDs around line 230). Using the pull request from Chris, I see all my AVDs and Genymotion emulators.
adb devices
will show only connected devices or running emulators, and as we all know ADB hangs frequently. Make sure you've doneadb kill-server
andadb start-server
before listing the devices, and make sure that the device is authorized to your computer.[~bgrantges] Regarding your first gist, you need to apply the attached PR to your SDK. My fix addresses the callback issue. As for the second gist, you need to select a Titanium SDK. For best results, select 3.3.0.GA:
Once you have selected SDK 3.3.0.GA and patched the SDK, everything should work fine.
Verified fix on: Mac OSX 10.9.4 Appcelerator Studio, build: 3.4.0.201408051600 Titanium SDK build: 3.4.0.v20140815142514, 3.3.0.GA Titanium CLI, build: 3.4.0-dev, 3.3.0 Alloy: 1.4.1 Genymotion emulator 4.4.2 Used the above test steps to mimic a stale Genymotion IP address, built KS to the emulator and when using the latest SDK(3.4.0.v20140815142514) and CLI(3.4.0-dev) the app built and Genymotion loaded. Reverted back to 3.3.0.GA SDK and 3.3.0 CLI to check using the same steps, there was an error thrown which was the same as in Bert's comment. Closing ticket.