Skip to content

Commit

Permalink
Re-fix #197 - ios-sim does not work for iPad-Pro for iOS 10 runtime
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
shazron committed Oct 28, 2016
1 parent d2ed3e1 commit cfae8dd
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/lib.js
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,10 @@ var lib = {
var name_id_map = {};

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

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

// replace hyphens in iPad Pro name which differ in 'Device Types' and 'Devices'
if (deviceName.indexOf('iPad Pro') === 0) {
deviceName = deviceName.replace(/\-/g, ' ').trim();
}

if (!(deviceName in name_id_map)) {
continue;
}
Expand Down

0 comments on commit cfae8dd

Please sign in to comment.