(dev *AndroidDevice)
| 60 | } |
| 61 | |
| 62 | func 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 |
no test coverage detected