Last active
February 7, 2018 16:32
-
-
Save donglua/72b37d7726ee63fd631c3c90dfda91e4 to your computer and use it in GitHub Desktop.
adb_tools
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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