新增apk安装测试

This commit is contained in:
zyj
2025-11-05 18:29:39 +08:00
parent e9612a0534
commit 969bfdb2d0

View File

@@ -1,8 +1,10 @@
package main package main
import ( import (
"encoding/json"
"fmt" "fmt"
"go-mobile-uiautomator/adb" "go-mobile-uiautomator/adb"
"go-mobile-uiautomator/services"
"time" "time"
) )
@@ -10,6 +12,23 @@ func main() {
} }
// 文件推送加安装
func FilePushInstall() {
addr := "127.0.0.1:5037"
// local := "./assets/app-uiautomator.apk"
// remote := "/sdcard/app-uiautomator.apk"
// mode := 0644
serial := "emulator-5556"
payload, _ := adb.ListDevicesRaw(addr, 15*time.Second)
m := adb.ParseDevicesPayload(payload)
b2, _ := json.MarshalIndent(m, "", " ")
fmt.Println(string(b2))
services.InstallServiceJar(addr, serial)
services.InstallServiceApk(addr, serial)
}
// 文件推送验证 // 文件推送验证
func FilePush() { func FilePush() {
// edit these for your environment // edit these for your environment