Skip to content

Instantly share code, notes, and snippets.

@donglua
Last active February 7, 2018 16:32
Show Gist options
  • Save donglua/72b37d7726ee63fd631c3c90dfda91e4 to your computer and use it in GitHub Desktop.
Save donglua/72b37d7726ee63fd631c3c90dfda91e4 to your computer and use it in GitHub Desktop.
adb_tools
package adb_tools
import (
"fmt"
"log"
"os/exec"
"strings"
)
func RunAdb(args ...string) {
out, err := exec.Command("adb", args...).Output()
fmt.Printf("%s", out)
if err != nil {
log.Fatalf("adb %s: %v", strings.Join(args, " "), err.Error())
}
}
func Devices() {
RunAdb("devices")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment