OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # | 2 # |
3 # Copyright 2013 The Chromium Authors. All rights reserved. | 3 # Copyright 2013 The Chromium Authors. All rights reserved. |
4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 | 6 |
7 """Installs an APK. | 7 """Installs an APK. |
8 | 8 |
9 """ | 9 """ |
10 | 10 |
11 import optparse | 11 import optparse |
12 import os | 12 import os |
13 import re | 13 import re |
14 import sys | 14 import sys |
15 | 15 |
16 from util import build_device | 16 from util import build_device |
17 from util import build_utils | 17 from util import build_utils |
18 from util import md5_check | 18 from util import md5_check |
19 | 19 |
20 BUILD_ANDROID_DIR = os.path.join(os.path.dirname(__file__), '..') | 20 BUILD_ANDROID_DIR = os.path.join(os.path.dirname(__file__), '..') |
21 sys.path.append(BUILD_ANDROID_DIR) | 21 sys.path.append(BUILD_ANDROID_DIR) |
22 | 22 |
| 23 from devil.android import apk_helper |
23 from pylib import constants | 24 from pylib import constants |
24 from pylib.utils import apk_helper | |
25 | 25 |
26 | 26 |
27 def GetNewMetadata(device, apk_package): | 27 def GetNewMetadata(device, apk_package): |
28 """Gets the metadata on the device for the apk_package apk.""" | 28 """Gets the metadata on the device for the apk_package apk.""" |
29 output = device.RunShellCommand('ls -l /data/app/') | 29 output = device.RunShellCommand('ls -l /data/app/') |
30 # Matches lines like: | 30 # Matches lines like: |
31 # -rw-r--r-- system system 7376582 2013-04-19 16:34 \ | 31 # -rw-r--r-- system system 7376582 2013-04-19 16:34 \ |
32 # org.chromium.chrome.apk | 32 # org.chromium.chrome.apk |
33 # -rw-r--r-- system system 7376582 2013-04-19 16:34 \ | 33 # -rw-r--r-- system system 7376582 2013-04-19 16:34 \ |
34 # org.chromium.chrome-1.apk | 34 # org.chromium.chrome-1.apk |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 record_path=record_path, | 109 record_path=record_path, |
110 input_paths=[options.apk_path], | 110 input_paths=[options.apk_path], |
111 force=force_install) | 111 force=force_install) |
112 | 112 |
113 if options.stamp: | 113 if options.stamp: |
114 build_utils.Touch(options.stamp) | 114 build_utils.Touch(options.stamp) |
115 | 115 |
116 | 116 |
117 if __name__ == '__main__': | 117 if __name__ == '__main__': |
118 sys.exit(main()) | 118 sys.exit(main()) |
OLD | NEW |