Slide 1

Slide 1 text

1 Migrating your mobile CI/CD environment to a scalable cloud solution using CircleCI Tadashi Nemoto CircleCI Senior Solutions Engineer

Slide 2

Slide 2 text

2 About this workshop Interested in moving your mobile CI/CD environment to cloud, but not sure where to start? Interested in speeding up builds and tests for mobile development? CircleCI has you covered! In this workshop, we’ll cover the basics of how mobile CI/CD projects work on CircleCI, how to migrate from on-prem to the cloud and discuss some of the pipeline optimizations you can use to increase your build speed and efficiency. Who will benefit from this workshop: ● DevOps engineers curious about mobile CI/CD ● Mobile developers interested in speeding up their builds and tests

Slide 3

Slide 3 text

3 Agenda ● Importance and Challenges of CI/CD in Mobile Development ● CircleCI Intro & key features for mobile development ● CircleCI Mobile Demo ● How to migrate mobile projects to CircleCI ● Summary / Q&A

Slide 4

Slide 4 text

4 Importance and Challenges of CI/CD in Mobile Development

Slide 5

Slide 5 text

5 https://www.prnewswire.com/news-releases/mobile-apps-market-size-to-grow-by-usd-653-91-billion--technavio-301511786.html

Slide 6

Slide 6 text

6 ● Can update software with low cost ● Retention rate is important for success ● Continuous quality improvements for various devices Important to provide and improve features quickly and continuously CI/CD(Continuous Integration/Continuous Delivery) is essential

Slide 7

Slide 7 text

7 Challenges of Mobile CI/CD ● Managing build fleet (especially Mac for iOS builds) ○ Requires machines with high specs ○ Provision and maintain Mac hardware ■ Buy your own, or use cloud providers with limitations ○ Regularly updating macOS and Xcode CI/CD is not yet implemented Managing on-prem environments(e.g Jenkins)

Slide 8

Slide 8 text

8 Problems of managing on-prem mobile CI/CD environment ● High maintenance cost ● Unable to scale development ● Low developer productivity ○ Slow build/test speed ○ Unstable build/test ○ Poor debugging experience ● Unsuitable for remote development https://devblogs.microsoft.com/devops/cloud-hosted-mac-agents-for-ci-cd-pipelines/

Slide 9

Slide 9 text

9 CircleCI intro & key features for mobile development

Slide 10

Slide 10 text

10 Creation Orchestration Operations Collaborate Source Control Where CircleCI Sits in the Toolchain Deliver Build • Test • Deliver・Release Run Monitor • Operate SHIP TO PRODUCTION CODE COMMIT

Slide 11

Slide 11 text

11 CircleCI case studies for mobile projects https://circleci.com/customers

Slide 12

Slide 12 text

12 CircleCI key features for mobile projects Resource Classes Choose from a vast fleet of executor types: Docker, Linux VM, macOS. All offer a range of CPUs, GPUs, memory, and images to customize each jobs Test splitting Shorten the feedback loop by automatically splitting your tests across parallel instances of the same job SSH debugging Securely access any job on CircleCI to debug builds and tests in real-time iOS Simulators Android Emulators Tests can run on them, including Xcode UITest(XCUITest), Espresso, and a snapshot test Orb(Integrations) Reusable snippets of code that help automate repeated process and speed up project setup Insights dashboard Insights allow team to improve engineering productivity

Slide 13

Slide 13 text

13 1. Powerful resource classes for mobile CI/CD https://circleci.com/ja/product/features/resource-classes/ Maintenance-free and on-demand machines are available

Slide 14

Slide 14 text

14 CircleCI provides powerful and constantly updated (especially macOS and Xcode) Mac environment ● CircleCI provides Apple Silicon Mac(M1 Mac) from 2023 Up to 2x faster build speed than Intel Mac ● Not guaranteed in SLA, but we aim to support a new Xcode within a couple of days. ○ https://circleci.com/docs/xcode-policy/ 1. Powerful resource classes for mobile CI/CD(Mac) Intel Mac M1(Apple Silicon) Mac

Slide 15

Slide 15 text

15 2. iOS Simulators / Android Emulators ● The iOS simulator can run on a macOS VM ● The x86 Android emulator can run on an Android VM ● Tests can run on iOS Simulators / Android emulators, including Xcode UITest (XCUITest), Espresso, and snapshot tests ● Booting and testing can be conducted in a clean environment every time

Slide 16

Slide 16 text

16 3. CircleCI Orb(Integrations) for mobile projects https://circleci.com/developer/orbs

Slide 17

Slide 17 text

17 4. Test Splitting “Any time a developer spends waiting for tests to run is time not spent writing the next piece of code, not to mention the cost of waiting around and losing context on what they’re working on. Fast feedback is everything.” - Rob Zuber One of the easiest ways to speed up builds on CircleCI is with test splitting. Particularly, splitting tests by timing data.The CircleCI test splitting mechanism takes in a list of tests and splits those tests across the number of nodes defined by the parallelism key.

Slide 18

Slide 18 text

18 5. Debugging with SSH The best way to troubleshoot problems is to securely debug problems within the job environment - while it’s running. Without SSH access to the build environment, a developer has to try to replicate the CI/CD environment in their dev environment in order to accurately identify the issue, then attempt to resolve it using only application, stack trace, and system logs. These types of situations are a huge waste of time for developers and SRE teams.

Slide 19

Slide 19 text

19 6. Insights / Test Insights Dashboard Pipeline Optimization: ● All workflow runs ● Success rate ● Duration ● Credit consumption Test Insights: ● Performance Summary ● Top 10 Most Failed Tests ● Top 10 Slowest Tests

Slide 20

Slide 20 text

20 CircleCI key features for mobile projects Resource Classes Choose from a vast fleet of executor types: Docker, Linux VM, macOS. All offer a range of CPUs, GPUs, memory, and images to customize each jobs Test splitting Shorten the feedback loop by automatically splitting your tests across parallel instances of the same job SSH debugging Securely access any job on CircleCI to debug builds and tests in real-time iOS Simulators Android Emulators Tests can run on them, including Xcode UITest(XCUITest), Espresso, and a snapshot test Orb(Integrations) Reusable snippets of code that help automate repeated process and speed up project setup Insights dashboard Insights allow team to improve engineering productivity

Slide 21

Slide 21 text

21 Demo

Slide 22

Slide 22 text

22 Android demonstration ● https://github.com/tadashi0713/circleci-demo-android ● Resource classes (Docker and Linux VM) ● Orbs ○ Android Orb (Gradle cache) ○ Ruby Orb (fastlane installation) ● Espresso test running on the Android emulator & Test splitting ● Distributed on Firebase App Distribution ● Insights dashboards and SSH debugging

Slide 23

Slide 23 text

23 iOS demonstration ● https://github.com/tadashi0713/circleci-demo-ios ● macOS resource classes (M1 Mac VM) ● Orbs ○ Ruby Orb (fastlane installation) ○ macOS Orb to preboot the iOS simulator ● XCUITest by using the iOS simulator & Test splitting ● Distributed on the fastlane match & Firebase App Distribution ● Insights dashboards and SSH debugging

Slide 24

Slide 24 text

24 Flutter / React Native ● Flutter ○ https://github.com/tadashi0713/circleci_flutter_demo ○ Flutter Orb (SDK installation and cache) ○ UI tests, fastlane match, and distributed on Firebase App Distribution ● React Native ○ https://github.com/tadashi0713/circleci-reactnative-detox-demo ○ React Native Orb (installation and cache) ○ UI test, distributed on Firebase App Distribution

Slide 25

Slide 25 text

25 How to migrate mobile projects to CircleCI

Slide 26

Slide 26 text

26 CircleCI and Fastlane ● We recommend using fastlane to simplify your mobile development pipeline ● Fastlane supports running tests, taking screenshots, iOS code signing (fastlane match), builds, distributing debug/beta versions, and releasing apps on App Store/Play Store ● https://docs.fastlane.tools/best-practices/continuous- integration/circle-ci/

Slide 27

Slide 27 text

27 iOS Code Signing on CircleCI ● We recommend using fastlane match for configuring iOS code signing on CircleCI. ● https://circleci.com/docs/ja/2.0/ios-codesigning/ https://qiita.com/kotarella1110/items/840af2cf80aaea1fb035

Slide 28

Slide 28 text

28 Mobile CI/CD Migration Strategies ● Start small! ● Don’t try to build the perfect pipeline from the beginning – aim for “good enough” ● Schedule time for retrospectives and continuous learning ● Migrate pipeline steps in the following order: ○ Build & Unit tests ○ Integration tests ○ Debug distribution ○ Release distribution

Slide 29

Slide 29 text

29

Slide 30

Slide 30 text

30

Slide 31

Slide 31 text

31

Slide 32

Slide 32 text

32 CircleCI Premium Support https://circleci.com/support/plans/

Slide 33

Slide 33 text

33 Summary / Q&A

Slide 34

Slide 34 text

34 Summary ● CI/CD is essential for continuous development of mobile development with high release frequency ● Mobile CI/CD tends to be a challenge in terms of build machines to run(especially Mac) ● CircleCI provides maintenance-free and on-demand machines required for mobile CI/CD, including Mac ● CircleCI provides strong features to increase your build speed and efficiency of your mobile CI/CD

Slide 35

Slide 35 text

35 CircleCI key features for mobile projects Resource Classes Choose from a vast fleet of executor types: Docker, Linux VM, macOS. All offer a range of CPUs, GPUs, memory, and images to customize each jobs Test splitting Shorten the feedback loop by automatically splitting your tests across parallel instances of the same job SSH debugging Securely access any job on CircleCI to debug builds and tests in real-time iOS Simulators Android Emulators Tests can run on them, including Xcode UITest(XCUITest), Espresso, and a snapshot test Orb(Integrations) Reusable snippets of code that help automate repeated process and speed up project setup Insights dashboard Insights allow team to improve engineering productivity

Slide 36

Slide 36 text

36 Thank you!!