Skip to content

Commit cfae8dd

Browse files
committed
Re-fix #197 - ios-sim does not work for iPad-Pro for iOS 10 runtime
The name of the device is not identical in 'Devices' and 'Device Types'. In 'Devices' for example, the 'iPad Pro (9.7 inch)' is 'iPad Pro (9.7-inch)' (note the hyphen). This makes iso-sim not match the device with the device type, which we need to get the runtime and device id support.
1 parent d2ed3e1 commit cfae8dd

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/lib.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,10 @@ var lib = {
294294
var name_id_map = {};
295295

296296
list.devicetypes.forEach(function(device) {
297+
// replace hyphens in iPad Pro name which differ in 'Device Types' and 'Devices'
298+
if (device.name.indexOf('iPad Pro') === 0) {
299+
device.name = device.name.replace(/\-/g, ' ').trim();
300+
}
297301
name_id_map[ device.name ] = device.id;
298302
});
299303

@@ -305,6 +309,11 @@ var lib = {
305309
for (var deviceName in druntimes) {
306310
var runtimes = druntimes[ deviceName ];
307311

312+
// replace hyphens in iPad Pro name which differ in 'Device Types' and 'Devices'
313+
if (deviceName.indexOf('iPad Pro') === 0) {
314+
deviceName = deviceName.replace(/\-/g, ' ').trim();
315+
}
316+
308317
if (!(deviceName in name_id_map)) {
309318
continue;
310319
}

0 commit comments

Comments
 (0)