Before apps can be deployed to iOS simulators and devices, the native project must be configured.
For Cordova, run the following:
Set the .
For Capacitor, open the
capacitor.config.json
file and modify theappId
property.For Cordova, open the file and modify the
id
attribute of the root element,<widget>
. See the Cordova documentation for more information.-
For Capacitor, run the following to open the app in Xcode:
For Cordova, open Xcode. Use File » Open and locate the app. Open the app's directory.
- In Project navigator, select the project root to open the project editor. Under the Identity section, verify that the Package ID that was set matches the Bundle Identifier.
In this workflow, Xcode can automatically fix common compilation and signing issues that can occur.
Develop the Ionic app and sync it to the native project.
With each meaningful change, Ionic apps must be built into web assets before the change can appear on iOS simulators and devices. The web assets then must be copied into the native project. Luckily, this process is made easy with a single Ionic CLI command.
For Capacitor, run the following:
$ ionic capacitor copy ios
- In Xcode, select a target simulator or device and click the play button.
The Ionic CLI can build, copy, and deploy Ionic apps to iOS simulators and devices with a single command. It can also spin up a development server, like the one used in ionic serve
, to provide
For Cordova, run the following to start a long-running CLI process that boots up a live-reload server:
Now, when changes are made to the app's source files, web assets are rebuilt and the changes are reflected on the simulator or device without having to deploy again.
Safari has Web Inspector support for iOS simulators and devices. Open the Develop menu and select the simulator or device, then select the Ionic App to open Web Inspector.
Native logs can be found in Xcode in the Console.