Skip to content

Commit

Permalink
Fix issue after updating to macOS 10.14.2.
Browse files Browse the repository at this point in the history
After updating to macOS 10.14.2, running `cordova run ios` causes error `Cannot read property 'name' of undefined`. It turns out that the problem is due to device.name including the '-'. It seems this changed with the update to Xcode 10.1 which seems to have been bundled along with the 10.14.2 update.
  • Loading branch information
amorgulis authored and dpogue committed Dec 13, 2018
1 parent 65015c1 commit 8b6f35c
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ function listEmulatorBuildTargets () {
var availableDevices = Object.keys(devices).reduce(function (availAcc, deviceCategory) {
var availableDevicesInCategory = devices[deviceCategory];
availableDevicesInCategory.forEach(function (device) {
if (device.name === deviceType.name.replace(/\-inch/g, ' inch')) {
if (device.name === deviceType.name || device.name === deviceType.name.replace(/\-inch/g, ' inch')) {
// Check new flag isAvailable (XCode 10.1+) or legacy string availability (XCode 10 and lower)
if (device.isAvailable || (device.availability && device.availability.toLowerCase().indexOf('unavailable') < 0)) {
availAcc.push(device);
Expand Down

0 comments on commit 8b6f35c

Please sign in to comment.