CI and CD are very popular words when we talk about modern development practises.

CI stands for Continuous Integration, it is engineering practise of frequently integrating isolated changes to a large code & test them simultaneously.

CD means Continuous Development or Continuous Delivery in which build software is always in a state of production or deploy.

Benefit of Continuous Integration/ Continuous Development/ Continuous Delivery

  • Less bugs are passed to production as mostly are captured during automated testing.
  • Generating a build is easy than earlier.
  • Developer will get to know about any bug in building stage & can work on fixing then before moving it to another stage.
  • QA team will get more time to improve the product quality instead of only testing the product.
  • It is easy to make small changes & encourage team to finish it fast.
  • Released builds are less risky & can be easily fixed.
  • Customer can notice continuous improvement & quality of product on everyday basis.

 

ci_cd_continuous_integration_continuous_delivery_fastlane_react_native_continuous_deployment_app_devops_app_store_automation

Implement CI/CD in iOS using Fastlane

Fastlane provides easiest way to automate & deploy your iOS and Android mobile apps. It helps you to generate screenshots, build , test and deploy app on App Store.

Install fastlane

Setup fastlane in project directory

This command will create 2 text file in your project: Appfile & Fastfile

fastlane_react_native_ci_cd_for_ios_apps_using_fastlane_continuous_integration_continuos_delivery_continuous_deployment_ios_react_native_fastlane

AppfileIt store very important information which are used by fastlane tool like Bundle In, Apple ID, iTunes Connect Team Id, Developer Team Id to build & deploy your app to App store or in TestFlight.

FastfileIt contains automation configuration that can be run with fastlane.

Here are process which we do for beta or App store realese

We have define 2 lanes for beta & app store release.

In terminal, inside your project root directory. Run this command to release your build on iTune connects.

Inside Lanes we define actions which we want to perform. If any step fails in lane then process will stop there.

In beta lane, we are increasing the build number, building IPA file and uploading to test flight.

In release lane, we are generating screenshots, building IPA file and uploading to iTune Connects.

Generating Provisioning Profile & Code Signing Certificate

Now, I will create a new lane named codeSign.

produce: This command will create App ID on developer accounts & App Account on iTune Connects.

cert: It will generate iPhone Developer & Distribution certificate for your app.

sigh: It will generate provisioning profile for app store.

If you already have metadata & screenshots on iTune Connect then run this command on terminal to get the same.

deliver: This will help you to update your existing metadata & screenshots on iTune Connects.

Why fastlane?

fastlane is the easiest way to automate beta deployments and releases for your iOS and Android apps. It handles all tedious tasks, like

  • Generating screenshots & metadata
  • Dealing with code signing & provisioning profile
  • Build your app
  • Releasing your application

Advantage of Using Fastlane

  • Save hours every time you push a new release to the store or beta testing service
  • Supports iOS, Mac, and Android apps
  • 100% open source
  • Easy setup assistant to get started in a few minutes
  • Never remember any commands any more, just fastlane
  • Extend and customise fastlane to fit your needs, you’re not dependent on anyone

Recommended References-

https://docs.fastlane.tools/

I hope you enjoyed this CI/CD with fastlane tutorial, and I look forward to seeing how you use fastlane in your deployment pipeline. If you have any questions or comments, please discussion below!

Stay connected to Codewave for more such insights and feel free to reach us at hello@codewave.in or +91 8971824910. If comfortable you may drop by at 1st Floor, Shree Chambers, #307, Outer Ring Rd, Banashankari 3rd Stage, Bengaluru, Karnataka 560085. Thanks for taking out time to read this article. We hope it enriched your existing knowledge. Do let us know your views, by sending an email to hello@codewave.in.

Neha Sharma

Neha Sharma

Sr. iOS Developer & Free Time Blogger. I am both driven and self-motivated and constantly experimenting with new technologies and techniques.

Leave a Reply