How to do it...

  1. Add the specific platform (such as iOS) and build the app using the following command line:
$ ionic cordova platform add ios$ ionic cordova build ios
  1. Note that you need to add the platforms to build the app. However, if you use the standard template from the Ionic CLI, it should already have the iOS platform included. To build and run for Android, you can replace iOS with Android.
  2. To emulate the app using the ios emulator, use the following command line:
$ ionic cordova emulate ios
  1. To run the app on the actual physical iPhone device, use the command line as shown:
$ ionic cordova run ios --device

Get Ionic Cookbook - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.