Trusted answers to developer questions
Trusted Answers to Developer Questions

Related Tags

flutter
communitycreator

How to deploy your Flutter app on Codemagic

Amey Sunu

What is Codemagic?

Codemagic is a CI/CD tool by Nevercode for Flutter app. Unlike your usual CI/CD, Codemagic is the best tool out there and it’s specifically made for Flutter.

You can visit it’s website at Codemagic.

Plus, you can use it for CI/CD and to build and deploy your apps to both Apple App Store and Google Play Store.

Using the tool, Flutter developers can even choose the type of Flutter versioning they need based on their app necessity. Developers can also deploy their security keys, such as for Firebase, using the encryption feature without worrying about any key leaks.

With Codemagic, you can view build statuses on Slack and on TestMagic(iOS and Android). TestMagic is an app by Codemagic used to monitor builds and tests within a mobile device. You can also download and install the build apks directly to your Android smartphones without any hassle.

Codemagic is my favorite CI/CD tool, and it’s really simple and easy to use. It also supports React Native, Apache Cordova, Ionic, and even Native Android and iOS developments too.

Getting started

  • Push your flutter project to your git repository and sign into Codemagic, preferably using your Github account.

  • You’ll be able to see the Apps folder, where all your applications from Github will be displayed.

Image

  • Choose your Flutter project and click on Start new build. You’ll then be directed to the screen below.

Build

  • You can see various build platforms for your Flutter Project. Tick those that you want to build/test.

  • The VM for build run is macOS Standard VM for free users, if you are a premium user, then feel free to choose builds on another VM.

  • On the right-hand side, you can choose your Workflow Settings, where you can timeout your build after a certain time period and manage build status and badges.

  • If you scroll down, you’ll find Build Triggers, Environment Variables, and Dependence Caching.

Within Build Triggers, you can choose when you want to trigger the build and how. Example: Say, you want to trigger the build whenever you push the code to a branch named dev. You can specify the branch you want to track and trigger based on your need.

Using Environment Variables, user can encrypt and API keys that you don’t want to store in the repository. You can access these variables in your code by adding the symbol in front of the variable name.

Dependency Caching allows to increase your build process by caching up areas that you don’t want to rebuild again.

Env

  • After setting up the above as needed we will have Test, Build, and Publish.

Test

You can see + signs in between Test, Build and Publish. These are post-scripts that you can run other than the default config if you’d like. They will be executed sequentially.

Within Test, you can specify Flutter Test types and arguments based on the created testings.

Build allows you to choose how you’d like your app to be build. You can choose from any version of Flutter including dev branch. You can also choose Xcode, CocoaPods versioning, build path, and type of Android Package to be generated.

Last, but not least, Publish allows you to publish the built app to your desired platforms, including Apple App Store and Google Play Store.

Once you are done setting everything up, you can begin the build. The build let you know once if it has succeeded or failed. So, the next time, you won’t have to manually keep building the app as it will automatically do so, depending on how you have configured the Trigger, and send you notifications via email.

Successful

You can also view build statuses and apks on your smartphone with the help of the Testmagic app.

You can read more about Codemagic and it’s awesome functionalities in the Codemagic Documentation.

RELATED TAGS

flutter
communitycreator
RELATED COURSES

View all Courses

Keep Exploring