mirror of
https://github.com/httprunner/httprunner.git
synced 2026-07-10 23:12:41 +08:00
fix: device serial/udid should be specified
This commit is contained in:
@@ -1 +1 @@
|
|||||||
v4.3.6.20230926
|
v4.3.6.2310081724
|
||||||
@@ -88,10 +88,13 @@ func NewAndroidDevice(options ...AndroidDeviceOption) (device *AndroidDevice, er
|
|||||||
for _, option := range options {
|
for _, option := range options {
|
||||||
option(device)
|
option(device)
|
||||||
}
|
}
|
||||||
|
|
||||||
deviceList, err := GetAndroidDevices(device.SerialNumber)
|
deviceList, err := GetAndroidDevices(device.SerialNumber)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, errors.Wrap(code.AndroidDeviceConnectionError, err.Error())
|
||||||
|
}
|
||||||
|
|
||||||
|
if device.SerialNumber == "" && len(deviceList) > 1 {
|
||||||
|
return nil, errors.Wrap(code.AndroidDeviceConnectionError, "more than one device connected, please specify the serial")
|
||||||
}
|
}
|
||||||
|
|
||||||
dev := deviceList[0]
|
dev := deviceList[0]
|
||||||
|
|||||||
@@ -237,6 +237,10 @@ func NewIOSDevice(options ...IOSDeviceOption) (device *IOSDevice, err error) {
|
|||||||
return nil, errors.Wrap(code.IOSDeviceConnectionError, err.Error())
|
return nil, errors.Wrap(code.IOSDeviceConnectionError, err.Error())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if device.UDID == "" && len(deviceList) > 1 {
|
||||||
|
return nil, errors.Wrap(code.IOSDeviceConnectionError, "more than one device connected, please specify the udid")
|
||||||
|
}
|
||||||
|
|
||||||
dev := deviceList[0]
|
dev := deviceList[0]
|
||||||
udid := dev.Properties().SerialNumber
|
udid := dev.Properties().SerialNumber
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user