Skip to main content

Native Builds

note

This feature is only available on our Standard or Enterprise plans. Please contact us to enable this feature.

Authentication

The Ionic Cloud CLI has to be authenticated on Appflow to be able to trigger a native build.

To log in, create a Personal Access Token on the Appflow Dashboard.

then type:

$ export IONIC_TOKEN=<your personal access token>

Trigger a native build

Assuming the CLI is authenticated, to trigger a native build, run:

$ ionic-cloud build <ios|android> <build_type> --app-id=<APPFLOW APP ID> --commit=<GIT COMMIT SHA> --signing-cert="My Signing Certificate"

Build type can be ad-hoc, app-store, development or enterprise for iOS and debug or release for Android.

Signing cert is required for all build types except debug on Android. For information on setting up signing certificates, see here.

Once the build is successfully triggered, the CLI will automatically start tailing the logs from Appflow.

Customize the native build with Options

The Options available to customize the build include:

  • --env=<name> Specify ad-hoc environment variables. You can use the flag any number of times to specify as many environment variables.
  • --env-file=<name> You can specify a file with any number of environment variables (one on each line).
  • --environment=<name> to specify the group of environment variables to be exposed to the build (more info about environments are available here)
  • --native-config=<name> to specify the group of native config variables to be exposed to your build (more info about native configs are available here)

Customize the native build with Advanced Options

The Advanced Options available to customize the build include:

  • --build-stack=<name> Overrides target build stack, defaults to latest stack
  • --apk Download Android APK artifact
  • --aab Download Android AAB artifact
  • --ipa Download iOS IPA artifact
  • --dsym Download iOS DSYM artifact
  • --apk-name=<name> To override the Android apk downloaded file name
  • --aab-name=<name> To override the Android aab downloaded file
  • --ipa-name=<name> To override the iOS ipa downloaded file
  • --dsym-name=<name> To override the iOS dsym downloaded file

Note about referencing Options values by name

Names are case-sensitive and need to be specified including spaces, for instance:

$ ionic-cloud build ios development --app-id=123 --commit=456 --signing-cert="iOS Dev"

Look for the name on the Signing Certificate, Environments, and Native Configs pages in Appflow:

Signing Certificates Environments Native Configs

For the build stack, use one of the strings identifying the platform in the Appflow Build page:

Target Platform

Contact Us