How to launch iOS apps in simulator with Ionic Framework

Tadashi Shigeoka ·  Sat, February 17, 2018

I’ll introduce how to launch iOS apps in simulator with Ionic Framework.

Ionic Framework | アイオニック フレームワーク

Ionic prerequisite environment

ionic -v
# 3.19.1
 
cordova -v
# 8.0.0

Build iOS app with Ionic

First, build the iOS app with the ionic cordova command.

ionic cordova build ios

A lot will be output, but if BUILD SUCCEEDED is displayed, it’s successful.

> cordova platform add ios --save
Using cordova-fetch for cordova-ios@~4.5.4

Adding ios project...

...

** BUILD SUCCEEDED **

Launch with Xcode

Running ionic cordova build ios generates files like the following in the platforms/ios directory.

$ ls -l platforms/ios 
total 32
drwxr-xr-x   7 youruser  staff   238  2 21 22:20 CordovaLib
drwxr-xr-x   4 youruser  staff   136  2 21 22:21 build
drwxr-xr-x  26 youruser  staff   884  2 21 22:20 cordova
-rw-r--r--   1 youruser  staff    48  2 21 22:21 frameworks.json
-rw-r--r--   1 youruser  staff  2951  2 21 22:21 ios.json
drwxr-xr-x  14 youruser  staff   476  2 21 22:20 your-app
drwxr-xr-x   3 youruser  staff   102  2 21 22:20 your-app.xcodeproj
drwxr-xr-x   4 youruser  staff   136  2 21 22:20 your-app.xcworkspace
drwxr-xr-x   7 youruser  staff   238  2 21 22:21 platform_www
-rw-r--r--   1 youruser  staff   860  2 21 22:20 pods-debug.xcconfig
-rw-r--r--   1 youruser  staff   859  2 21 22:20 pods-release.xcconfig
drwxr-xr-x  12 youruser  staff   408  2 21 22:21 www

Opening the file with .xcodeproj extension will launch Xcode.

open platforms/ios/your-app.xcodeproj

Finally, clicking the ▷ play button in Xcode will launch the iOS Simulator, allowing you to test the iOS app developed with Ionic Framework.

That’s all from the Gemba where I want to develop iOS apps with Ionic Framework.

References