2015-07-11 21:32:04 +00:00
|
|
|
package goadb
|
|
|
|
|
2015-07-12 06:18:58 +00:00
|
|
|
import (
|
|
|
|
"os/exec"
|
|
|
|
|
|
|
|
"github.com/zach-klippenstein/goadb/util"
|
|
|
|
)
|
2015-07-11 21:32:04 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
StartServer ensures there is a server running.
|
|
|
|
*/
|
|
|
|
func StartServer() error {
|
|
|
|
cmd := exec.Command("adb", "start-server")
|
2015-07-12 06:18:58 +00:00
|
|
|
err := cmd.Run()
|
|
|
|
return util.WrapErrorf(err, util.ServerNotAvailable, "error starting server: %s", err)
|
2015-07-11 21:32:04 +00:00
|
|
|
}
|