cmd/gomobile: always display stdout from abd

Fixes golang/go#12418

Change-Id: Ie0f2e669b3e516787b548c69a624e9063cd7f68f
Reviewed-on: https://go-review.googlesource.com/14160
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
This commit is contained in:
David Crawshaw 2015-09-01 10:12:56 -04:00
parent fee22db634
commit 471eeebd99
1 changed files with 15 additions and 2 deletions

View File

@ -6,8 +6,10 @@ package main
import (
"fmt"
"os"
"os/exec"
"path/filepath"
"strings"
)
var cmdInstall = &command{
@ -34,10 +36,21 @@ func runInstall(cmd *command) error {
if err := runBuild(cmd); err != nil {
return err
}
return runCmd(exec.Command(
// Don't use runCmd as adb does not return a useful exit code.
c := exec.Command(
`adb`,
`install`,
`-r`,
filepath.Base(pkg.Dir)+`.apk`,
))
)
c.Stdout = os.Stdout
c.Stderr = os.Stderr
if buildX || buildN {
printcmd("%s", strings.Join(c.Args, " "))
}
if buildN {
return nil
}
return c.Run()
}