how to pick the ios emulator from cordova / ionic command line

With later versions of Ionic and Cordova one can use any of the following commands to list available emulations. The following commands have been tested with Ionic v3.20.0 and Cordova 8.0.0:

ionic cordova emulate --list # List any OS
cordova run --list           # List any OS
cordova run ios --list       # List specific OS

And they yield something like:

Available ios virtual devices:
iPhone-5s, 11.2
iPhone-6, 11.2
iPhone-6-Plus, 11.2
iPhone-6s, 11.2
iPhone-6s-Plus, 11.2
iPhone-7, 11.2
iPhone-7-Plus, 11.2
iPhone-8, 11.2
iPhone-8-Plus, 11.2
iPhone-SE, 11.2
iPhone-X, 11.2
iPad-Air, 11.2
iPad-Air-2, 11.2
iPad--5th-generation-, 11.2
iPad-Pro--9-7-inch-, 11.2
iPad-Pro, 11.2
iPad-Pro--12-9-inch---2nd-generation-, 11.2
iPad-Pro--10-5-inch-, 11.2
Apple-Watch-38mm, watchOS 4.2
Apple-Watch-42mm, watchOS 4.2
Apple-Watch-Series-2-38mm, watchOS 4.2
Apple-Watch-Series-2-42mm, watchOS 4.2
Apple-Watch-Series-3-38mm, watchOS 4.2
Apple-Watch-Series-3-42mm, watchOS 4.2
Apple-TV-1080p, tvOS 11.2

To start the emulator with a specific OS use:

ionic cordova emulate ios --target "iPhone-X"

See also:
https://cordova.apache.org/docs/en/latest/reference/cordova-cli/#cordova-run-command

For an older installation of Ionic and Cordova I used the syntax mentioned in RipTheJacker’s answer to select the device to emulate, ie:

ionic emulate ios --target="iPhone-4s"

However, to find out what the available emulations are I run this:

ios-sim showdevicetypes

This command will return a list, something like this:

iPhone-4s, 8.4
iPhone-5, 8.4
iPhone-5s, 8.4
iPhone-6-Plus, 8.4
iPhone-6, 8.4
iPad-2, 8.4
iPad-Retina, 8.4
iPad-Air, 8.4
Resizable-iPhone, 8.4
Resizable-iPad, 8.4

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)