refactor: move gidevice to hrp pkg

This commit is contained in:
debugtalk
2022-10-23 22:25:14 +08:00
parent d9422f3771
commit 863ffdf798
85 changed files with 10476 additions and 65 deletions

View File

@@ -3,9 +3,10 @@ package ios
import (
"fmt"
giDevice "github.com/electricbubble/gidevice"
"github.com/mitchellh/mapstructure"
"github.com/spf13/cobra"
"github.com/httprunner/httprunner/v4/hrp/pkg/gidevice"
)
type Application struct {
@@ -24,21 +25,21 @@ var listAppsCmd = &cobra.Command{
return err
}
var applicationType giDevice.ApplicationType
var applicationType gidevice.ApplicationType
switch appType {
case "user":
applicationType = giDevice.ApplicationTypeUser
applicationType = gidevice.ApplicationTypeUser
case "system":
applicationType = giDevice.ApplicationTypeSystem
applicationType = gidevice.ApplicationTypeSystem
case "internal":
applicationType = giDevice.ApplicationTypeInternal
applicationType = gidevice.ApplicationTypeInternal
case "all":
applicationType = giDevice.ApplicationTypeAny
applicationType = gidevice.ApplicationTypeAny
}
result, errList := device.InstallationProxyBrowse(
giDevice.WithApplicationType(applicationType),
giDevice.WithReturnAttributes("CFBundleVersion", "CFBundleDisplayName", "CFBundleIdentifier"))
gidevice.WithApplicationType(applicationType),
gidevice.WithReturnAttributes("CFBundleVersion", "CFBundleDisplayName", "CFBundleIdentifier"))
if errList != nil {
return fmt.Errorf("get app list failed")
}

View File

@@ -5,15 +5,15 @@ import (
"fmt"
"os"
giDevice "github.com/electricbubble/gidevice"
"github.com/pkg/errors"
"github.com/spf13/cobra"
"github.com/httprunner/httprunner/v4/hrp/pkg/gidevice"
"github.com/httprunner/httprunner/v4/hrp/pkg/uixt"
)
type Device struct {
d giDevice.Device
d gidevice.Device
UDID string `json:"UDID"`
Status string `json:"status"`
ConnectionType string `json:"connectionType"`

View File

@@ -4,9 +4,9 @@ import (
"fmt"
"os"
giDevice "github.com/electricbubble/gidevice"
"github.com/spf13/cobra"
"github.com/httprunner/httprunner/v4/hrp/pkg/gidevice"
"github.com/httprunner/httprunner/v4/hrp/pkg/uixt"
)
@@ -15,7 +15,7 @@ var iosRootCmd = &cobra.Command{
Short: "simple utils for ios device management",
}
func getDevice(udid string) (giDevice.Device, error) {
func getDevice(udid string) (gidevice.Device, error) {
devices, err := uixt.IOSDevices(udid)
if err != nil {
return nil, err