Build and Deploy your App
Now that you have built your first app, you are going to want to get it distributed so everyone can start using it. The mechanics of building and deploying your application can be quite cumbersome. That is where Appflow comes into play. Appflow allows you to effectively generate web and native builds, push out live app updates, publish your app to the app stores, and automate the whole process. The entire Quickstart guide can be found here.
Below we will run through an overview of the steps.
Connect Your Repo
Appflow works directly with Git version control and uses your existing code base as the source of truth for Deploy and Package builds. You will first need to integrate with your hosting service, such as GitHub or Bitbucket, or you can push your code directly to Appflow. Once this is completed, Appflow will have access to your code.
For more on connecting your code repository to Appflow, checkout the Connect your Repo section inside the Appflow docs.
Install the Appflow SDK
The Appflow SDK (also known as Ionic Deploy plugin) will allow you to take advantage of arguably two of the best Appflow features: deploying live updates to your app and bypassing the app stores. Ionic Appflow's Live Update feature is shipped with Appflow SDK and features the capabilities of detecting and syncing the updates for your app that you have pushed to your identified channels within the dashboard.
To get the Appflow SDK plugin added to your project, you can follow the install instructions within the Appflow Dashboard by clicking on "Install Instructions" inside of the Deploy > Destinations
section. Alternatively, you can install the plugin manually by executing the following command in your app's root directory:
ionic deploy add \
--app-id="YOUR_APP_ID" \
--channel-name="YOUR_CHANNEL_NAME" \
--update-method="background|auto|none" \
For prerequisite and additional instructions on installing the Appflow SDK, visit the Install the Appflow SDK section inside the Appflow docs.
Push a Commit
In order for Appflow to access the latest and greatest changes to your code, you will need to push a commit via the version control integration of your choosing. For those that use GitHub or Bitbucket, this would look as follows:
git add . # stage any changes
git commit -m "added appflow sdk" # commit staged changes
git push origin main # push the changes from the main branch to your git host
After the push is made, you will then see your commit under the Commits
tab of the Appflow Dashboard. For more on this, take a look at the Push a Commit section inside the Appflow docs.
Deploy a Live Update
With the Appflow SDK installed and your commit pushed up to the Dashboard, you are ready to deploy a live update to a device. The Live Update feature uses the installed Appflow SDK with your native application to listen to a particular Deploy Channel Destination. When a live update is assigned to a Channel Destination, that update will be deployed to user devices running binaries that are configured to listen to that specific Channel Destination.
To get the live update deployed, a Web build will need to be created. This can be done through the Start build
icon from the Commits
tab or by clicking the New build
button in the top right corner of the Build > Builds
tab. After selecting the correct commit to deploy, select the Web
target platform and the Latest
build stack. Depending on your Appflow plan, you will then be able to include custom environments, if any are configured. Finally, you can enable Live Update
and pick the Channel to automatically assign the build to once it successfully completes.
Upon completion of the Web Build, additional versioning options are available to you. After completing this section and you have a successful Deploy build, you can then assign it to the same Channel you configured the Appflow SDK to listen to when you installed it by clicking the Deploy live updates
button in the build detail page. The same can be done by clicking the Deploy live updates
icon on the build in the Build > Builds
tab and select the Channel from the dropdown.
To receive this live update, you will need to run the app on a device or an emulator. The quickest and easiest way to do this is through the following command:
ionic [cordova | cap] run [ios | android] [options]