mirror of
https://github.com/httprunner/httprunner.git
synced 2026-06-01 05:49:40 +08:00
refactor: move gidevice to hrp pkg
This commit is contained in:
@@ -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")
|
||||
}
|
||||
|
||||
@@ -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"`
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user