MCPcopy Index your code
hub / github.com/httprunner/httprunner / GetAndroidDeviceOptions

Function GetAndroidDeviceOptions

hrp/pkg/uixt/android_device.go:62–79  ·  view source on GitHub ↗
(dev *AndroidDevice)

Source from the content-addressed store, hash-verified

60}
61
62func GetAndroidDeviceOptions(dev *AndroidDevice) (deviceOptions []AndroidDeviceOption) {
63 if dev.SerialNumber != "" {
64 deviceOptions = append(deviceOptions, WithSerialNumber(dev.SerialNumber))
65 }
66 if dev.UIA2 {
67 deviceOptions = append(deviceOptions, WithUIA2(true))
68 }
69 if dev.UIA2IP != "" {
70 deviceOptions = append(deviceOptions, WithUIA2IP(dev.UIA2IP))
71 }
72 if dev.UIA2Port != 0 {
73 deviceOptions = append(deviceOptions, WithUIA2Port(dev.UIA2Port))
74 }
75 if dev.LogOn {
76 deviceOptions = append(deviceOptions, WithAdbLogOn(true))
77 }
78 return
79}
80
81// uiautomator2 server must be started before
82// adb shell am instrument -w io.appium.uiautomator2.server.test/androidx.test.runner.AndroidJUnitRunner

Callers 1

parseConfigMethod · 0.92

Calls 5

WithSerialNumberFunction · 0.85
WithUIA2Function · 0.85
WithUIA2IPFunction · 0.85
WithUIA2PortFunction · 0.85
WithAdbLogOnFunction · 0.85

Tested by

no test coverage detected