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:

  1. Add the native platform to your app:

    # iOS platform
    ionic capacitor add ios
    # Android platform
    ionic capacitor add android
  2. (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 NSMicrophoneUsageDescription and NSCameraUsageDescription keys to the Info.plist file 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:

    1. In the app folder, go to iOS > App folder and open the generated XCode workspace file: <appname>.xcworkspace.

    2. In Xcode, go to the Info tab.

    3. In the Custom iOS Target Properties section, hover over any key in the list and click the plus icon to the right.

    4. From the list, select Privacy - Microphone Usage Description.

    5. 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.

    6. Repeat the steps above to add the Privacy - Camera Usage Description key.

  3. 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