anchor.diff:      ${stdenv.lib.optionalString (app != null) ''
         # Install the App through the debugger, if it has not been installed yet
   
  -      if [ -z "${package}" ] || [ "$(${androidsdkComposition}/libexec/android-sdk/platform-tools/adb -s emulator-$port shell pm list packages | grep package:${package})" = "" ]
  +      if [ -z "${package}" ] || [ "$(${sdk}/libexec/android-sdk/platform-tools/adb -s emulator-$port shell pm list packages | grep package:${package})" = "" ]
         then
             if [ -d "${app}" ]
             then
  
positive.code:     export ANDROID_SERIAL="emulator-$port"
  
      # Create a virtual android device for testing if it does not exists
      ${androidsdkComposition}/libexec/android-sdk/tools/android list targets
  
      if [ "$(${androidsdkComposition}/libexec/android-sdk/tools/android list avd | grep 'Name: device')" = "" ]
      then
          # Create a virtual android device
          yes "" | ${androidsdkComposition}/libexec/android-sdk/tools/android create avd -n device -t 1 --abi ${systemImageType}/${abiVersion} $NIX_ANDROID_AVD_FLAGS
  
          ${stdenv.lib.optionalString enableGPU ''
            # Enable GPU acceleration
  
negative.code:               appPath="${app}"
            fi
  
            ${sdk}/libexec/android-sdk/platform-tools/adb -s emulator-$port install "$appPath"
        fi
  
        # Start the application
        ${stdenv.lib.optionalString (package != null && activity != null) ''
            ${sdk}/libexec/android-sdk/platform-tools/adb -s emulator-$port shell am start -a android.intent.action.MAIN -n ${package}/${activity}
        ''}
      ''}
      EOF
  