The following guest blog post is from Titan Trevor Ward. Thanks for the contribution, Trevor.
I was fortunate to attend the Titanium App Camp in Atlanta. This event was awesome and, although I was there to help out, I managed to spend sometime on Saturday evening to undertake Tech Debt. With so many of the senior Titans and quite a few Appcelerator personnel, including Jeff Haynie, in attendance, I decided to have a full look at the new Android emulator Genymotion.
With a few guidance points from Stephen Feather, Genymotion was up and running within a very short time. Then the issues started (none of which remain unresolved).
Firstly, let’s see what Genymotion does. Go to https://www.genymotion.com/ and sign up. Yes, you have to sign up but at the current time it’s free.
If you have already signed up then you have to go into the sign up screen to login. After logging in, go to the user guide and installation section. You will need to install the Oracle VirtualBox as well as Genymotion follow the instructions and your away.
Run Genymotion
Go ahead and add a device. Just click “add” and follow the instructions. When you run it you will see what Genymotion can offer. It is very fast. Ok, that’s an understatement.
The first thing you will notice is that this is a full blown Android emulator. It acts just like a device, with one exception – it’s faster than most Android devices.
Until Titanium 3.2 comes out (Yes it’s being supported by Appcelerator), there is no direct link from studio to run the emulator and install your application directly. So here is a little script you can use.
#!/bin/sh
rm -r build/android
ti build -p android -b
echo 'Installing Project to Device'
adb install -r build/android/bin/app.apk
exit
Place the script in the main application directory, start a Genymotion emulator and run the script. (OK it’s a script for Mac, but I’m sure you can create one for windows if needed).
Here are a few gotcha’s
Running Titanium Studio with cloud services enabled works for both Alloy and Classic applications, however the same cannot be said for the Appcelerator Platform. The cloud test framework causes issues with the emulator and ends up with some awesomely weird results.
To get round this, uninstall the “com-soasta-touchtest“ module from the application. Be aware that just removing it from the TiApp.xml GUI will not fully uninstall it, you need to go into the xml and comment it out.
Your application should now be running. If not, it may depend on what other modules you have running. Quite a few modules need to be compiled to run with the X86 emulator.
Go to ~/Library/Application Support/Titanium/modules/android/”module”/”version”/libs and see if there is an X86 directory. If so, you are good to go. If not you may need to get it compiled incorporating the x86 emulation.
If the application doesn’t install on the emulator, make sure that you have only 1 emulator running and no other Android devices connected.
Now what can you use it for
Well firstly Genymotion will give you a very productive and efficient Android emulator to use during development. Additionally, it will also give you an emulator that can be used to run your applications after development. This is excellent for customer service teams, demonstrations and a multitude of other uses.
You can also install any applications from the google store, test flight and any other of the methods used to install applications.
A final note: if you run the Android Monitor while running the emulator, you will get a complete runtime diagnostic. This is an ideal way to spot any reasons why application modules are failing to run. Enjoy!