In this tutorial, you will learn, the list of available iOS emulator for Ionic 2 project on Mac OS Sierra operating system. And how to run the Ionic 2 application using the specific iOS emulator instead of using the default iOS emulator.

In iOS, if you are not mentioning the iOS emulator, it will try to load the application using the default iOS emulator. So let's see how to run the application using the specific iOS emulator.

Prerequisite:

Mac OS
Xcode Editor
Ionic

Please use the below link to learn, how to install the Ionic on Mac OS Sierra. Ignore if you already did this.

https://ampersandacademy.com/tutorials/ionic-framework-version-2/installing-ionic-2-framework-on-mac-os-sierra

Please use the below link to learn, how to install the Xcode Editor on Mac OS Sierra. Ignore if you already did this.

https://ampersandacademy.com/tutorials/ionic-framework-version-2/setup-xcode-editor-for-ionic-2-application-on-mac-os-sierra


Now create a new Ionic2 project using the below command.

ionic start newapp blank --v2

You can able to see the list of installed platforms using the below command.

cd newapp
ionic platform

output:
Installed platforms:
  android 6.1.2
  ios 4.1.1
Available platforms: 
  amazon-fireos ~3.6.3 (deprecated)
  blackberry10 ~3.8.0
  browser ~4.1.0
  firefoxos ~3.6.3
  osx ~4.0.1
  webos ~3.7.0

In Mac OS, the iOS platform by default added to the Ionic 2 project when you are creating the new Ionic 2 project. So there is no need to add the iOS platform.

If you want to add the iOS platform use the below command.

ionic platform add ios

Execute the below command inside your Ionic 2 project to see the list of available iOS emulator

./platforms/ios/cordova/lib/list-emulator-images

output:

iPhone-5, 10.2
iPhone-5s, 10.2
iPhone-6, 10.2
iPhone-6-Plus, 10.2
iPhone-6s, 10.2
iPhone-6s-Plus, 10.2
iPhone-7, 10.2
iPhone-7-Plus, 10.2
iPhone-SE, 10.2
iPad-Retina, 10.2
iPad-Air, 10.2
iPad-Air-2, 10.2
Apple-TV-1080p, tvOS 10.1
Apple-Watch-38mm, watchOS 3.1
Apple-Watch-42mm, watchOS 3.1
Apple-Watch-Series-2-38mm, watchOS 3.1
Apple-Watch-Series-2-42mm, watchOS 3.1

The above command displays the available iOS emulator. These emulators won't come by default. You have to download and install those iOS emulators using the Xcode emulator. 

If you are not specifying the target emulator, it will try to load the iOS Ionic 2 app on the default iOS emulator. 

ionic run ios

However, if you want to run the Ionic 2 application on a specific iOS emulator, use the below command

ionic emulate ios --target="Emulator Name"

For iPhone 6s
 

ionic emulate ios --target="iPhone-6"

Tested:


Mac OS Sierra
Xcode Editor Version 8.2.1 

Below are Ionic 2 info while writing this tutorial.

Cordova CLI: 6.5.0 
Ionic Framework Version: 3.1.1
Ionic CLI Version: 2.2.1
Ionic App Lib Version: 2.2.0
Ionic App Scripts Version: 1.3.7
ios-deploy version: Not installed
ios-sim version: 5.0.13 
OS: macOS Sierra
Node Version: v6.10.0
Xcode version: Xcode 8.2.1