Flutter Engine
The Flutter Engine
push_to_android.py
Go to the documentation of this file.
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
8import os
9import subprocess
10import sys
11
12host, serial, stamp = sys.argv[1:]
13device = '/data/local/tmp/' + os.path.basename(host)
14
15restrict = [] if serial == 'auto' else ['-s', serial]
16
17# adb push is verbose, so eat its output with check_output().
18subprocess.check_output(['adb'] + restrict + ['push', host, device])
19subprocess.check_call(['adb'] + restrict + ['shell', 'chmod', '+x', device])
20
21# Touch a file to let GN/Ninja know we succeeded.
22with open(stamp, 'w'):
23 pass