diff --git a/hrp/internal/version/VERSION b/hrp/internal/version/VERSION index 9c6a0187..d87fdf6c 100644 --- a/hrp/internal/version/VERSION +++ b/hrp/internal/version/VERSION @@ -1 +1 @@ -v4.3.6.20230926 \ No newline at end of file +v4.3.6.2310081724 \ No newline at end of file diff --git a/hrp/pkg/uixt/android_device.go b/hrp/pkg/uixt/android_device.go index 42b4757e..84edf057 100644 --- a/hrp/pkg/uixt/android_device.go +++ b/hrp/pkg/uixt/android_device.go @@ -88,10 +88,13 @@ func NewAndroidDevice(options ...AndroidDeviceOption) (device *AndroidDevice, er for _, option := range options { option(device) } - deviceList, err := GetAndroidDevices(device.SerialNumber) 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] diff --git a/hrp/pkg/uixt/ios_device.go b/hrp/pkg/uixt/ios_device.go index 843a34b3..b5283667 100644 --- a/hrp/pkg/uixt/ios_device.go +++ b/hrp/pkg/uixt/ios_device.go @@ -237,6 +237,10 @@ func NewIOSDevice(options ...IOSDeviceOption) (device *IOSDevice, 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] udid := dev.Properties().SerialNumber