Error run on IOS emulator after update to IOS 11 - Ionic 3

wstudiokiwi picture wstudiokiwi · Sep 20, 2017 · Viewed 7.7k times · Source

After update to IOS 11, command

ionic cordova run ios -lc --target="iPhone-6"

I have error

** BUILD SUCCEEDED **

No available runtimes could be found for "iPhone 6". [ERROR] An error occurred while running cordova run ios --target iPhone-6 (exit code 1).

Simulators list after command

ios-sim showdevicetypes

Apple-TV-1080p, tvOS 11.0
Apple-TV-4K-4K, tvOS 11.0
Apple-TV-4K-1080p, tvOS 11.0
Apple-Watch-38mm, watchOS 4.0
Apple-Watch-42mm, watchOS 4.0
Apple-Watch-Series-2-38mm, watchOS 4.0
Apple-Watch-Series-2-42mm, watchOS 4.0
Apple-Watch-Series-3-38mm, watchOS 4.0
Apple-Watch-Series-3-42mm, watchOS 4.0
iPhone-5s, 11.0
iPhone-6, 11.0
iPhone-6-Plus, 11.0
iPhone-6s, 11.0
iPhone-6s-Plus, 11.0
iPhone-7, 11.0
iPhone-7-Plus, 11.0
iPhone-SE, 11.0
iPhone-8, 11.0
iPhone-8-Plus, 11.0
iPhone-X, 11.0
iPad-Air, 11.0
iPad-Air-2, 11.0
iPad--5th-generation-, 11.0
iPad-Pro--9-7-inch-, 11.0
iPad-Pro, 11.0
iPad-Pro--12-9-inch---2nd-generation-, 11.0
iPad-Pro--10-5-inch-, 11.0

BUT after command

cordova emulate ios --list

Simulators list is empty

Available iOS Simulators:
MacBook-Air-apple:Snaptofix2 apple$

Help, please.

Answer

Peter Stegnar picture Peter Stegnar · Sep 22, 2017

Here is problem that you are using (or better say ionic) still old version of ios-sim npm package. As apple changed simulators in iOS 11 (and platform).

Solution is to use latest ios-sim (this is valid for 22.09.2017, next week should be release a official version). So this would be mean just update ios-sim package.

Today, you need to use "latest" version.

Like:

cd platforms/ios/cordova && npm install ios-sim@latest

Here is also open issue: https://github.com/phonegap/ios-sim/issues/218

Other option is to upgrade the whole ios platform to a proper version (for iOS 11 you need at least 4.5.0):

cordova platform add [email protected]

(Be careful to remove platform first!)