Index: build/android/adb_install_content_shell |
diff --git a/build/android/adb_install_content_shell b/build/android/adb_install_content_shell |
index 3667998cdc044c6703c95ed0e06fb4c9ccb0c4f9..d94d5544bdb0ceb52e7c57c69bbabef4af00135c 100755 |
--- a/build/android/adb_install_content_shell |
+++ b/build/android/adb_install_content_shell |
@@ -1,26 +1,20 @@ |
-#!/bin/bash |
+#!/usr/bin/env python |
bulach
2012/08/09 12:36:52
nice! :)
Isaac (away)
2012/08/10 04:44:35
I thought you'd like that :-)
|
# |
# Copyright (c) 2012 The Chromium Authors. All rights reserved. |
# Use of this source code is governed by a BSD-style license that can be |
# found in the LICENSE file. |
-CONTENT_SHELL_APK=${CHROME_SRC}/out/Release/content_shell/ContentShell-debug.apk |
+import os |
+from pylib import android_commands |
-if [ ! -f "${CONTENT_SHELL_APK}" ]; then |
- echo "Error: Could not find ${CONTENT_SHELL_APK} to install." |
- exit 1 |
-fi |
+devices = android_commands.GetAttachedDevices() |
+apk_path = os.path.join(os.environ['CHROME_SRC'], |
+ 'out/Release/content_shell/ContentShell-debug.apk') |
-DEVS=$(adb devices | grep device | grep -v devices | awk '{ print $1 }') |
+if not devices: |
+ print 'Error: no connected devices' |
+ exit(1) |
-if [[ -z $DEVS ]]; then |
- echo "Error: No connected devices. Device needed to run content shell test." |
- exit 1 |
-fi |
- |
-for DEV in ${DEVS}; do |
- # Reinstall content shell. This will also kill existing content_shell procs. |
- echo "Installing ${CONTENT_SHELL_APK} in ${DEV}" |
- adb -s ${DEV} uninstall org.chromium.content_shell |
- adb -s ${DEV} install -r ${CONTENT_SHELL_APK} |
-done |
+for device in devices: |
+ print android_commands.AndroidCommands(device=device).ManagedInstall( |
+ apk_path, False, 'org.chromium.content_shell') |