Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(168)

Side by Side Diff: build/android/provision_devices.py

Issue 26364002: [android] FlagChanger should only require root to set flags for Chrome. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix bug Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | build/android/pylib/constants.py » ('j') | build/android/pylib/flag_changer.py » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # 2 #
3 # Copyright (c) 2013 The Chromium Authors. All rights reserved. 3 # Copyright (c) 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 """Provisions Android devices with settings required for bots. 7 """Provisions Android devices with settings required for bots.
8 8
9 Usage: 9 Usage:
10 ./provision_devices.py [-d <device serial number>] 10 ./provision_devices.py [-d <device serial number>]
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 LaunchHostHeartbeat() 65 LaunchHostHeartbeat()
66 66
67 67
68 def ProvisionDevices(options): 68 def ProvisionDevices(options):
69 if options.device is not None: 69 if options.device is not None:
70 devices = [options.device] 70 devices = [options.device]
71 else: 71 else:
72 devices = android_commands.GetAttachedDevices() 72 devices = android_commands.GetAttachedDevices()
73 for device in devices: 73 for device in devices:
74 android_cmd = android_commands.AndroidCommands(device) 74 android_cmd = android_commands.AndroidCommands(device)
75 android_cmd.RunShellCommand('su -c date -u %f' % time.time()) 75 android_cmd.RunShellCommandWithSU('date -u %f' % time.time())
76 if options.auto_reconnect: 76 if options.auto_reconnect:
77 PushAndLaunchAdbReboot(devices, options.target) 77 PushAndLaunchAdbReboot(devices, options.target)
78 78
79 79
80 def main(argv): 80 def main(argv):
81 parser = optparse.OptionParser() 81 parser = optparse.OptionParser()
82 parser.add_option('-d', '--device', 82 parser.add_option('-d', '--device',
83 help='The serial number of the device to be provisioned') 83 help='The serial number of the device to be provisioned')
84 parser.add_option('-t', '--target', default='Debug', help='The build target') 84 parser.add_option('-t', '--target', default='Debug', help='The build target')
85 parser.add_option( 85 parser.add_option(
86 '-r', '--auto-reconnect', action='store_true', 86 '-r', '--auto-reconnect', action='store_true',
87 help='Push binary which will reboot the device on adb disconnections.') 87 help='Push binary which will reboot the device on adb disconnections.')
88 options, args = parser.parse_args(argv[1:]) 88 options, args = parser.parse_args(argv[1:])
89 constants.SetBuildType(options.target) 89 constants.SetBuildType(options.target)
90 90
91 if args: 91 if args:
92 print >> sys.stderr, 'Unused args %s' % args 92 print >> sys.stderr, 'Unused args %s' % args
93 return 1 93 return 1
94 94
95 ProvisionDevices(options) 95 ProvisionDevices(options)
96 96
97 97
98 if __name__ == '__main__': 98 if __name__ == '__main__':
99 sys.exit(main(sys.argv)) 99 sys.exit(main(sys.argv))
OLDNEW
« no previous file with comments | « no previous file | build/android/pylib/constants.py » ('j') | build/android/pylib/flag_changer.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698