aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/android/incremental_install.py
diff options
context:
space:
mode:
authorGravatar Alex Humesky <ahumesky@google.com>2015-09-22 00:41:11 +0000
committerGravatar Laszlo Csomor <laszlocsomor@google.com>2015-09-22 17:06:41 +0000
commitf0a5ac60547751b34b3c307a6a4e47f8c791a720 (patch)
tree8b7d781b1f948ce0df8280b0a91c8cb5e8b1fba1 /tools/android/incremental_install.py
parent8e055ba53848bc78a95e54c0d91c021bcc82b9c4 (diff)
Improve error message for INSTALL_FAILED_OLDER_SDK from adb.
Clean up some tests. -- MOS_MIGRATED_REVID=103600539
Diffstat (limited to 'tools/android/incremental_install.py')
-rw-r--r--tools/android/incremental_install.py15
1 files changed, 12 insertions, 3 deletions
diff --git a/tools/android/incremental_install.py b/tools/android/incremental_install.py
index 04da8cd0bf..c49f2ec0c2 100644
--- a/tools/android/incremental_install.py
+++ b/tools/android/incremental_install.py
@@ -106,6 +106,10 @@ class TimestampException(Exception):
"""Raised when there is a problem with timestamp reading/writing."""
+class OldSdkException(Exception):
+ """Raised when the SDK on the target device is older than the app allows."""
+
+
class Adb(object):
"""A class to handle interaction with adb."""
@@ -156,6 +160,8 @@ class Adb(object):
# "error: " to the beginning, so take it off so that we don't end up
# printing "Error: error: ..."
raise MultipleDevicesError(re.sub("^error: ", "", stderr))
+ elif "INSTALL_FAILED_OLDER_SDK" in stdout:
+ raise OldSdkException()
if adb.returncode != 0:
raise AdbError(args, adb.returncode, stdout, stderr)
@@ -729,9 +735,12 @@ def IncrementalInstall(adb_path, execroot, stub_datafile, output_marker,
sys.exit("Error: Device unauthorized. Please check the confirmation "
"dialog on your device.")
except MultipleDevicesError as e:
- sys.exit(
- "Error: " + e.message + "\nTry specifying a device serial with " +
- "\"blaze mobile-install --adb_arg=-s --adb_arg=$ANDROID_SERIAL\"")
+ sys.exit("Error: " + e.message + "\nTry specifying a device serial with "
+ "\"blaze mobile-install --adb_arg=-s --adb_arg=$ANDROID_SERIAL\"")
+ except OldSdkException as e:
+ sys.exit("Error: The device does not support the API level specified in "
+ "the application's manifest. Check minSdkVersion in "
+ "AndroidManifest.xml")
except TimestampException as e:
sys.exit("Error:\n%s" % e.message)
except AdbError as e: