refactor: replace gadb with optimized version authoried by @appl3s

This commit is contained in:
lilong.129
2023-04-13 22:41:45 +08:00
parent 6600473855
commit 3d4dffbd0b
13 changed files with 509 additions and 34 deletions

View File

@@ -3,6 +3,7 @@
package gadb
import (
"io/ioutil"
"testing"
)
@@ -127,3 +128,22 @@ func TestClient_KillServer(t *testing.T) {
t.Fatal(err)
}
}
func TestScreenCap(t *testing.T) {
adbClient, err := NewClient()
if err != nil {
t.Fatal(err)
}
dl, err := adbClient.DeviceList()
if err != nil {
t.Error(err)
}
d := dl[0]
res, err := d.RunShellCommandV2WithBytes("screencap", "-p")
if err != nil {
t.Error(err)
}
t.Log(len(res))
ioutil.WriteFile("/tmp/1.png", res, 0o644)
}