Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-14637] Android: Fix Titanium Build Script in order to support Genymotion Android Emulator

GitHub Issuen/a
TypeNew Feature
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2013-09-06T22:23:30.000+0000
Affected Version/sRelease 3.1.1
Fix Version/s2013 Sprint 18 Core, 2013 Sprint 18, Release 3.2.0
ComponentsAndroid, Tooling
Labelsandroid, android-deployment, android-packaging, androidbuild, build, cb-verified, cli, genymotion, module_android, qe-testadded, simulator
ReporterYgor Lemos
AssigneeChris Barber
Created2013-07-23T19:05:26.000+0000
Updated2013-11-20T19:03:05.000+0000

Description

Genymotion is an enhanced android emulator that leverages x86 emulation with builtin HAXM-like optimizations and Google APIs. In order to have an simulator with a performance like the iOS Simulator we need to setup a x86 android emulation with Intel HAXM support. The problem is that by using the native AVD on Android SDK you can do this setup BUT without the Google APIs, namely the GMaps API, which makes testing apps depending on those APIs, impossible on this high performance simulation. Although it is possible to add Google APIs to a standard x86 AVD, the process is very complex and involves copying the libraries from other non-x86 AVDs and rebuilding a system image which takes a lot of time and effort for each simulator setup you want to have. So Genymotion does it all under the hood and allows us to select between several android models and even simulate external sensors and GPS location, much like the Apple Simulator does. The standard Titanium build script has some problems that causes the Simulator session not to be recognized as a valid deployment target (using titanium build -p android -T device), even though adb successfully recognizes the simulation under adb devices. In order to fix this I have found some hints on a russian weblog and changed it a bit for working on my Mac. I have successfully run my Titanium app on Genymotion using Titanium CLI by doing the following: http://reinraus.ru/wordpress/nastraivaem-titanium-studio-dlya-zapuska-prilozhenij-v-android-x86/ It is written in Russian, so please use the Google Translate tool, he has made 3 changes on the build script. The tutorial is for windows, so if you're running Titanium on a Mac or Windows, just change the first patch from:
dev_id, dev_type=output.split("\r\n")[1].split("\t")
to:
dev_id, dev_type=output.split("\n")[1].split("\t")
It seems there is still a tiny problem with Logcat on the end, but the app successfully run on Genymotion after this patch.

Attachments

FileDateSize
builder.py2013-07-23T19:25:28.000+000096981

Comments

  1. Ygor Lemos 2013-07-23

    Follows my builder.py script patched and working attached to this issue.
  2. Quang Pham 2013-08-06

    one vote for this :)
  3. Chris Barber 2013-09-04

    Pull request: https://github.com/appcelerator/titanium_mobile/pull/4646
  4. Timan Rebel 2013-10-17

    @Chris could you explain in one sentence hoe to use the new setup?
  5. Chris Barber 2013-10-17

    [~timanrebel] This feature is not ready for preview. It is unstable and has not been merged into master yet which means it's not in the CI builds. You'll be able to preview the new and much improved Android build system shortly. Just hang in there a little while longer. :)
  6. Timan Rebel 2013-10-17

    [~cbarber] I understand, I will keep using my customized builder.py for now then. Thanks!

JSON Source