anchor.diff:        ${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}
  +      ${stdenv.lib.optionalString (package != null && activity != null) ''
  +          ${androidsdkComposition}/libexec/android-sdk-*/platform-tools/adb -s emulator-$port shell am start -a android.intent.action.MAIN -n ${package}/${activity}
  +      ''}
       ''}
       EOF
       chmod +x $out/bin/run-test-emulator
  
positive.code:         export TMPDIR=/tmp
      fi
      
      # Store the virtual devices somewhere else, instead of polluting a user's HOME directory
      export ANDROID_SDK_HOME=$(mktemp -d $TMPDIR/nix-android-vm-XXXX)
      
      # We have to look for a free TCP port
      
  
negative.code: { name, app ? null
  , platformVersion ? "8", abiVersion ? "armeabi-v7a", useGoogleAPIs ? false
  , enableGPU ? false, extraAVDFiles ? []
  , package ? null, activity ? null
  , avdHomeDir ? null
  }:
  
  let
    androidsdkComposition = androidsdk {
  