| OLD | NEW |
| (Empty) |
| 1 // Copyright 2015 The Go Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style | |
| 3 // license that can be found in the LICENSE file. | |
| 4 | |
| 5 package main | |
| 6 | |
| 7 import ( | |
| 8 "os" | |
| 9 "os/exec" | |
| 10 "path/filepath" | |
| 11 ) | |
| 12 | |
| 13 var cmdInstall = &command{ | |
| 14 run: runInstall, | |
| 15 Name: "install", | |
| 16 Usage: "[package]", | |
| 17 Short: "compile android APK and/or iOS app and install on device", | |
| 18 Long: ` | |
| 19 Install compiles and installs the app named by the import path on the | |
| 20 attached mobile device. | |
| 21 | |
| 22 This command requires the 'adb' tool on the PATH. | |
| 23 | |
| 24 See the build command help for common flags and common behavior. | |
| 25 `, | |
| 26 } | |
| 27 | |
| 28 func runInstall(cmd *command) error { | |
| 29 if err := runBuild(cmd); err != nil { | |
| 30 return err | |
| 31 } | |
| 32 install := exec.Command( | |
| 33 `adb`, | |
| 34 `install`, | |
| 35 `-r`, | |
| 36 filepath.Base(pkg.Dir)+`.apk`, | |
| 37 ) | |
| 38 if buildV { | |
| 39 install.Stdout = os.Stdout | |
| 40 install.Stderr = os.Stderr | |
| 41 } | |
| 42 return install.Run() | |
| 43 } | |
| OLD | NEW |