Mike Klein | 7d92103 | 2017-01-05 12:20:41 -0500 | [diff] [blame^] | 1 | #!/usr/bin/env python |
| 2 | # |
| 3 | # Copyright 2016 Google Inc. |
| 4 | # |
| 5 | # Use of this source code is governed by a BSD-style license that can be |
| 6 | # found in the LICENSE file. |
| 7 | |
| 8 | import os |
| 9 | import subprocess |
| 10 | import sys |
| 11 | |
| 12 | host, serial, stamp = sys.argv[1:] |
| 13 | device = '/data/local/tmp/' + os.path.basename(host) |
| 14 | |
| 15 | # adb push is verbose, so eat its output with check_output(). |
| 16 | subprocess.check_output(['adb', '-s', serial, 'push', host, device]) |
| 17 | subprocess.check_call(['adb', '-s', serial, 'shell', 'chmod', '+x', device]) |
| 18 | |
| 19 | # Touch a file to let GN/Ninja know we succeeded. |
| 20 | with open(stamp, 'w'): |
| 21 | pass |