iOS and Android deployment¶
To build and deploy your Ionic project as a native iOS or Android app, you can use Capacitor.
Capacitor is installed in new Ionic apps by default. To use it in existing projects, make sure you have installed and initialized Capacitor with your app name and bundle ID. For details, see Capacitor documentation.
After Capacitor is installed:
Add the native platform to your app:
# iOS platform ionic capacitor add ios # Android platform ionic capacitor add android
(For iOS) In iOS, the user must explicitly grant permission for an app to access the user’s data and resources. An app with the Alan AI button requires access to:
User’s device microphone for voice interactions
User’s device camera for testing Alan AI projects on mobile
To comply with this requirement, you must add
NSCameraUsageDescriptionkeys to the
Info.plistfile of your app and provide a message why your app requires access to the microphone and camera. The message will be displayed only when Alan AI needs to activate the microphone or camera. Do the following:
In the app folder, go to iOS > App folder and open the generated XCode workspace file:
In Xcode, go to the Info tab.
In the Custom iOS Target Properties section, hover over any key in the list and click the plus icon to the right.
From the list, select Privacy - Microphone Usage Description.
In the Value field to the right, provide a description for the added key. This description will be displayed to the user when the app is launched.
Repeat the steps above to add the Privacy - Camera Usage Description key.
Use the following commands to open your app in the IDE, run it on the device or simulator or build it for the native platform:
# iOS platform ionic capacitor open ios ionic capacitor run ios ionic capacitor build ios # Android platform ionic capacitor open android ionic capacitor run android ionic capacitor build android