Added command output to StartServer error.
This commit is contained in:
parent
aea57fe58f
commit
f8a8785326
|
@ -2,6 +2,7 @@ package goadb
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"os/exec"
|
"os/exec"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/zach-klippenstein/goadb/util"
|
"github.com/zach-klippenstein/goadb/util"
|
||||||
)
|
)
|
||||||
|
@ -11,6 +12,7 @@ StartServer ensures there is a server running.
|
||||||
*/
|
*/
|
||||||
func StartServer() error {
|
func StartServer() error {
|
||||||
cmd := exec.Command("adb", "start-server")
|
cmd := exec.Command("adb", "start-server")
|
||||||
err := cmd.Run()
|
output, err := cmd.CombinedOutput()
|
||||||
return util.WrapErrorf(err, util.ServerNotAvailable, "error starting server: %s", err)
|
outputStr := strings.TrimSpace(string(output))
|
||||||
|
return util.WrapErrorf(err, util.ServerNotAvailable, "error starting server: %s\noutput:\n%s", err, outputStr)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue