mirror of
https://github.com/httprunner/httprunner.git
synced 2026-06-08 09:19:41 +08:00
refactor: replace gadb with optimized version authoried by @appl3s
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user