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 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 metadata = GetNewMetadata(device, apk_package) | 47 metadata = GetNewMetadata(device, apk_package) |
48 if not metadata: | 48 if not metadata: |
49 raise Exception('APK install failed unexpectedly.') | 49 raise Exception('APK install failed unexpectedly.') |
50 | 50 |
51 with open(metadata_path, 'w') as outfile: | 51 with open(metadata_path, 'w') as outfile: |
52 outfile.write(metadata) | 52 outfile.write(metadata) |
53 | 53 |
54 | 54 |
55 def main(argv): | 55 def main(argv): |
56 parser = optparse.OptionParser() | 56 parser = optparse.OptionParser() |
57 parser.add_option('--android-sdk-tools', | |
58 help='Path to Android SDK tools.') | |
59 parser.add_option('--apk-path', | 57 parser.add_option('--apk-path', |
60 help='Path to .apk to install.') | 58 help='Path to .apk to install.') |
61 parser.add_option('--install-record', | 59 parser.add_option('--install-record', |
62 help='Path to install record (touched only when APK is installed).') | 60 help='Path to install record (touched only when APK is installed).') |
63 parser.add_option('--build-device-configuration', | 61 parser.add_option('--build-device-configuration', |
64 help='Path to build device configuration.') | 62 help='Path to build device configuration.') |
65 parser.add_option('--stamp', | 63 parser.add_option('--stamp', |
66 help='Path to touch on success.') | 64 help='Path to touch on success.') |
67 options, _ = parser.parse_args() | 65 options, _ = parser.parse_args() |
68 | 66 |
(...skipping 23 matching lines...) Expand all Loading... |
92 record_path=record_path, | 90 record_path=record_path, |
93 input_paths=[options.apk_path], | 91 input_paths=[options.apk_path], |
94 force=force_install) | 92 force=force_install) |
95 | 93 |
96 if options.stamp: | 94 if options.stamp: |
97 build_utils.Touch(options.stamp) | 95 build_utils.Touch(options.stamp) |
98 | 96 |
99 | 97 |
100 if __name__ == '__main__': | 98 if __name__ == '__main__': |
101 sys.exit(main(sys.argv)) | 99 sys.exit(main(sys.argv)) |
OLD | NEW |