Recently, I had the privilege to present a lightning talk at React Day Berlin 2022 for the first time. It was a wonderful day and it was great meeting people from different countries. The video can be viewed on this link
During the talk, I talked about the importance of DevOps and CI/CD for React Native apps or mobile apps in general. Because of this, I’d like to share with you what is the nutshell guide for that.
Sounds interesting! Let’s get started!
As we know, working with cross-platform apps — such as React Native — introduces different challenges because we are mainly working with two different mobile apps, Android and iOS. Let’s explore together the most challenges we have especially for the deployment and release processes.
Escaping React Native release hell
When it comes to releasing React Native apps, teams experience the following challenges:
- Different requirements, processes, and workflows for iOS and Android
- Code signing hell
- Complicated configuration
- Tests that fail or don’t provide accurate results
- Slow release processes
- Inflexible and fragile CI servers
Our goal should be to “spend less time on tasks that slow developers down and more time on the code that matters”
Don’t waste the developer hours fixing CI issues, testing the apps manually, or trying to solve the complexity of the configuration. Instead, focus on the features and the business itself. The other issues can be solved with by introducing Mobile DevOps best practices into processes and tooling.
To be able to tackle all of these challenges, we should figure out what is the process or the solution to do that.
From my point of view, the key here is “Automation”.
Scott Hanselman said, “The most powerful tool we have as developers is automation.”
Here we are not talking about automation testing, no! We are referring to automating tasks that can be automated – such as testing, code signing, releasing, code review, or monitoring.
Mobile DevOps helps tackle mobile-specific challenges and provide us with a process to deliver secured, qualitative, and frequent mobile apps to our customers.
How to adopt Mobile DevOps for React Native apps
There are six steps or stages to adopting Mobile DevOps with your team:
1- Measuring
2- CI/CD Strategy
3- Building
4- Testing
5- Releasing
6- Monitoring
At each stage, collaboration and discussion is required for the cross-function team to achieve their goal together. And this is the benefit of being an Agile team and thinking in an agile way to transform the team process to be more productive.
After implementing Mobile DevOps processes and designing the CI/CD Workflows, we should be able to build, test, sign, release, and all the other tasks for the React Native apps in the following manner:
In some instances, your team might run into another challenge with this implementation, asking themselves, “should we run the workflows in a sequential way, or do we need to think about another solution to reduce the run time?” To do this, you can use Pipelines to trigger parallel workflows at the same time.
Build Pipelines
Pipelines can be used to organize the entire CI/CD process and to set up advanced configurations with multiple different tasks running parallel and/or sequentially. For instance, we can implement the previous workflows for iOS and Android with the Pipelines.
Another idea or solution that can be used with your React Native apps is to use fastlane to configure and use automated tasks in one place which will help the team to run all the required tasks easily with the CI server.
The question now is: should we use an in-house CI server or a cloud-based CI server?
Cloud CI/CD Benefits for React Native apps
The cloud-based CI for React Native apps has the same benefits as well, such as:
- Easy project setup
- Ready-made environment
- Customizable workflows for iOS and Android
- Seamless code signing for iOS and Android
- Automated unit, integration, and E2E tests
- Distribute React Native apps with ease
- Pay only for the resources that you consumed (pay as you go)
Cloud computing is a game changer. Most companies migrate from dedicated servers to the cloud to experience better security, scalability, availability, and fault tolerance.
The takeaways
As we explained in this article, Mobile DevOps helps mobile teams release mobile apps quickly and with confidence, but don’t forget:
- Mobile DevOps is a mindset, culture, process, and tools
- CI/CD is the coordination process
- Test automation is a vital part of Mobile DevOps
- Mobile DevOps is a journey, not a destination
Related resources
Thank you for reading and happy building!