feat: 安装方案更改为go-ios

This commit is contained in:
余泓铮
2024-08-19 14:36:15 +08:00
parent ff9bac2a5e
commit 4441945358
2 changed files with 3 additions and 20 deletions
+1 -1
View File
@@ -1 +1 @@
v4.6.4 v4.6.5
+2 -19
View File
@@ -11,7 +11,6 @@ import (
"os" "os"
"path/filepath" "path/filepath"
"strconv" "strconv"
"strings"
"time" "time"
"github.com/pkg/errors" "github.com/pkg/errors"
@@ -475,15 +474,7 @@ func (dev *IOSDevice) StopPcap() string {
func (dev *IOSDevice) Install(appPath string, opts *InstallOptions) (err error) { func (dev *IOSDevice) Install(appPath string, opts *InstallOptions) (err error) {
for i := 0; i <= opts.RetryTime; i++ { for i := 0; i <= opts.RetryTime; i++ {
err = builtin.RunCommandWithCallback("ideviceinstaller", []string{"-u", dev.UDID, "-i", appPath}, func(line string) bool { err = builtin.RunCommand("go-ios", "install", "--path="+appPath, "--udid="+dev.UDID)
if strings.Contains(line, "Complete") {
return true
}
if strings.Contains(line, "90%") {
return true
}
return false
})
if err == nil { if err == nil {
return nil return nil
} }
@@ -492,15 +483,7 @@ func (dev *IOSDevice) Install(appPath string, opts *InstallOptions) (err error)
} }
func (dev *IOSDevice) Uninstall(bundleId string) error { func (dev *IOSDevice) Uninstall(bundleId string) error {
return builtin.RunCommandWithCallback("ideviceinstaller", []string{"-u", dev.UDID, "-U", bundleId}, func(line string) bool { return builtin.RunCommand("go-ios", "uninstall", bundleId, "--udid="+dev.UDID)
if strings.Contains(line, "Complete") {
return true
}
if strings.Contains(line, "90%") {
return true
}
return false
})
} }
func (dev *IOSDevice) forward(localPort, remotePort int) error { func (dev *IOSDevice) forward(localPort, remotePort int) error {