API Development

How to detect and run code specific to Genymotion Emulators

When you are running test you might need to differentiate for specific environments. For example, if you haven’t patched your Genymotion emulators to include the missing Google Apps you would need to skip any tests that use Google Play Services like for ti.map.
To detect which emulator you are running your code in, you can use Ti.Platform.manufacturer, which returns unknown on Android Virtual Devices, but Genymotion on Genymotion emulators.

Example Code

var isGenymotion = (Ti.Platform.name === 'android' && Ti.Platform.manufacturer === 'Genymotion');
var win = Ti.UI.createWindow();
  text: 'You ' + (isGenymotion ? 'ARE' : 'ARE NOT') + ' using Genymotion.\n' +
        'The manufacturer is: ' + Ti.Platform.manufacturer


Reconsider using AVDs

Genymotion became a popular alternative for the infamous slow AVDs. However, you might want to reconsider. Most of them include Google APIs, the performance has improved a lot recently and Android Studio makes it very easy to manage AVDs for tons of common devices:
And yes, these AVDs work fine with Titanium!
Code Strong! ?