mirror of
https://github.com/appium/appium.git
synced 2026-02-09 19:28:48 -06:00
deviceString improvements
This commit is contained in:
@@ -830,14 +830,20 @@ IOS.prototype.getDeviceString = function () {
|
||||
var isTall = isiPhone;
|
||||
var isRetina = this.xcodeVersion[0] !== '4';
|
||||
var is64bit = false;
|
||||
if (this.args.deviceName) {
|
||||
var device = this.args.deviceName.toLowerCase();
|
||||
var deviceName = this.args.deviceName;
|
||||
var fixDevice = true;
|
||||
if (deviceName && deviceName[0] === '='){
|
||||
deviceName = deviceName.substring(1);
|
||||
fixDevice = false;
|
||||
}
|
||||
if (deviceName) {
|
||||
var device = deviceName.toLowerCase();
|
||||
if (device.indexOf("iphone") !== -1) {
|
||||
isiPhone = true;
|
||||
} else if (device.indexOf("ipad") !== -1) {
|
||||
isiPhone = false;
|
||||
}
|
||||
if (this.args.deviceName !== this.args.platformName) {
|
||||
if (deviceName !== this.args.platformName) {
|
||||
isTall = isiPhone && (device.indexOf("4-inch") !== -1);
|
||||
isRetina = (device.indexOf("retina") !== -1);
|
||||
is64bit = (device.indexOf("64-bit") !== -1);
|
||||
@@ -856,7 +862,7 @@ IOS.prototype.getDeviceString = function () {
|
||||
if (isiPhone) {
|
||||
if (isRetina && isTall) {
|
||||
iosDeviceString += is64bit ? " (4-inch 64-bit)" : " (4-inch)";
|
||||
} else if (this.args.deviceName.toLowerCase().indexOf("3.5") !== -1) {
|
||||
} else if (deviceName.toLowerCase().indexOf("3.5") !== -1) {
|
||||
iosDeviceString += " (3.5-inch)";
|
||||
}
|
||||
} else {
|
||||
@@ -867,6 +873,18 @@ IOS.prototype.getDeviceString = function () {
|
||||
iosDeviceString += " - Simulator - iOS " +
|
||||
(this.args.platformVersion || this.iOSSDKVersion);
|
||||
}
|
||||
if (fixDevice) {
|
||||
// Some device config are broken in 5.1
|
||||
var CONFIG_FIX = {
|
||||
'iPhone - Simulator - iOS 7.1': 'iPhone Retina (4-inch 64-bit) - Simulator - iOS 7.1',
|
||||
'iPad - Simulator - iOS 7.1': 'iPad Retina (64-bit) - Simulator - iOS 7.1'
|
||||
};
|
||||
if (CONFIG_FIX[iosDeviceString]) {
|
||||
iosDeviceString = CONFIG_FIX[iosDeviceString];
|
||||
logger.debug("Fixing device was changed from:\"", iosDeviceString, "\" to:\"",
|
||||
CONFIG_FIX[iosDeviceString] + "\"");
|
||||
}
|
||||
}
|
||||
return iosDeviceString;
|
||||
};
|
||||
|
||||
|
||||
Submodule submodules/appium-instruments updated: f4838f4e33...b6742230ea
Reference in New Issue
Block a user