From 1f42b026247b657be72ee1867e9d2df84c588e8f Mon Sep 17 00:00:00 2001 From: Sander van der Burg Date: Tue, 28 Jan 2014 19:09:08 +0100 Subject: [PATCH] androidenv: also allow references to individual apk files --- pkgs/development/mobile/androidenv/emulate-app.nix | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pkgs/development/mobile/androidenv/emulate-app.nix b/pkgs/development/mobile/androidenv/emulate-app.nix index 9c843fa8c373..536878681028 100644 --- a/pkgs/development/mobile/androidenv/emulate-app.nix +++ b/pkgs/development/mobile/androidenv/emulate-app.nix @@ -95,7 +95,15 @@ stdenv.mkDerivation { ${stdenv.lib.optionalString (app != null) '' # Install the App through the debugger - ${androidsdkComposition}/libexec/android-sdk-*/platform-tools/adb -s emulator-$port install ${app}/*.apk + + if [ -d "${app}" ] + then + appPath="$(echo ${app}/*.apk)" + else + appPath="${app}" + fi + + ${androidsdkComposition}/libexec/android-sdk-*/platform-tools/adb -s emulator-$port install "$appPath" # Start the application ${androidsdkComposition}/libexec/android-sdk-*/platform-tools/adb -s emulator-$port shell am start -a android.intent.action.MAIN -n ${package}/.${activity}