aboutsummaryrefslogtreecommitdiffhomepage
path: root/gn/push_to_android.py
blob: b9ab36fa5208cc70e0ab574f9ae4f5201af6791e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/env python
#
# Copyright 2016 Google Inc.
#
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import os
import subprocess
import sys

host, serial, stamp = sys.argv[1:]
device = '/data/local/tmp/' + os.path.basename(host)

# adb push is verbose, so eat its output with check_output().
subprocess.check_output(['adb', '-s', serial, 'push', host, device])
subprocess.check_call(['adb', '-s', serial, 'shell', 'chmod', '+x', device])

# Touch a file to let GN/Ninja know we succeeded.
with open(stamp, 'w'):
  pass