Now x86 and mips images from external repositories are supported + added GPU option to the emulate function

This commit is contained in:
Sander van der Burg
2013-07-31 18:56:27 +02:00
parent c324091a77
commit 1c8b4c8950
10 changed files with 412 additions and 46 deletions
@@ -1,8 +1,12 @@
{stdenv, androidsdk}:
{name, app, platformVersion ? "8", useGoogleAPIs ? false, package, activity}:
{name, app, platformVersion ? "8", abiVersion ? "armeabi-v7a", useGoogleAPIs ? false, enableGPU ? false, package, activity}:
let
androidsdkComposition = androidsdk { inherit useGoogleAPIs; platformVersions = [ platformVersion ]; };
androidsdkComposition = androidsdk {
inherit useGoogleAPIs;
platformVersions = [ platformVersion ];
abiVersions = [ abiVersion ];
};
in
stdenv.mkDerivation {
inherit name;
@@ -48,6 +52,11 @@ stdenv.mkDerivation {
# Create a virtual android device
${androidsdkComposition}/libexec/android-sdk-*/tools/android create avd -n device -t ${if useGoogleAPIs then "'Google Inc.:Google APIs:"+platformVersion+"'" else "android-"+platformVersion}
# Enable GPU acceleration
${stdenv.lib.optionalString enableGPU ''
echo "hw.gpu.enabled=yes" >> $ANDROID_SDK_HOME/.android/avd/device.avd/config.ini
''}
# Launch the emulator
${androidsdkComposition}/libexec/android-sdk-*/tools/emulator -avd device -no-boot-anim -port $port &