/ ionic

Ionic Cordova Emulate ios target issue

[[email protected], Xcode 9.0]

I recently ran into an issue after updating to the latest version of Xcode (9.0) where running an app on a simulator errored because no devices could be found.

So running this command ionic cordova emulate ios --target="iPhone 6s, 11.0" gives me an error and fails to fire up the simulator.

When I ran ionic cordova emulate ios --list to see the available devices, I got zero results returned.

If I ran ios-sim showdevicetypes I get the list below:

iPhone-5s, 11.0
iPhone-6, 11.0
iPhone-6-Plus, 11.0
iPhone-6s, 11.0
iPhone-6s-Plus, 11.0
iPad-Air, 11.0
iPad-Air-2, 11.0
iPad-Pro--9-7-inch-, 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-7, 11.0
iPhone-7-Plus, 11.0
iPhone-SE, 11.0
iPad--5th-generation-, 11.0
iPad-Pro--12-9-inch---2nd-generation-, 11.0
iPad-Pro--10-5-inch-, 11.0
Apple-TV-1080p, tvOS 11.0
Apple-TV-4K-4K, tvOS 11.0
Apple-TV-4K-1080p, tvOS 11.0
iPhone-8, 11.0
iPhone-8-Plus, 11.0
iPhone-X, 11.0
iPad-Pro, 11.0

So I know there are simulators available. So to check which version of the ios platform is installed with Cordova I ran cordova platform --list. It was showing ios 4.0.1. There is a newer version available and after installing it cordova platform rm ios cordova platfrom add [email protected] I was then able to run in the simulator with no issues.

ionic cordova emulate ios --livereload -c --target="iPhone 6, 11.0"