1. Cong Nguyen @ 2021
Be productive with automation
Introduction to Fastlane, Match, Rome and Bitrise
for iOS development teams
congnd
congndcom
2. Agenda
• The need of automation
• Introduction to Rome
• Introduction to Fastlane
• Introduction to Bitrise
• Use Slack to communicate with Bitrise
3. Why do we need automation?
• Simplify work
fl
ow
• Save time and money
• No one wants to handle boring and repeated tasks
• Prevent human mistakes
• Having fun
6. Introduction to Rome
What is Rom? What does it help us?
• Cache engine for Carthage which support many cloud storage provider
includes S3 and GCS.
• You build your frameworks one and just download it to reuse latter.
• Easy to use and maintain
• Easy to write new plugin to support any new storage provider
• Can manage multiple version of Swift
7. Introduction to Rome
Why do we need Rome?
• Reduce the time to wait for building all the frameworks by Carthage
• Faster onboarding new members
• Share built frameworks across members’s PC and CI servers
• Save time
• Save a lot of money on CI servers
• Reduce the time to distribute new versions
8. Introduction to Rome
Con
fi
guration
cache:
local: ~/Library/Caches/Rome # Cache directory
engine: scripts/rome-engine.sh # Custom cache engine
repositoryMap: # Mapping repository name to frameworks
- RxSwift: # The repo name
- name: RxSwift # The framework produced by the repo
platforms: [iOS] # The framework platform
- name: RxCocoa # Another framework produced by the repo
platforms: [iOS] # The framework platform
The custom engine we are using:
https://github.com/congnd/rome-gcs-engine
9. Introduction to Fastlane
Why Fastlane?
• Widely used by the community
• Many many cool things are supported
• Simplify & Unify the con
fi
guration (CI server and local machine)
• Nicely solve the certi
fi
cate & provisioning pro
fi
le nightmare
• It’s free & well documented
• It saves your day
[04:52:34]: fastlane.tools just saved you 20 minutes! 🎉
10. Introduction to Fastlane
What it can do?
And many more…
https://docs.fastlane.tools/actions/
✦ Testing
✦ Building
✦ Screenshots
✦ Project
✦ Code Signing
✦ Documentation
✦ Beta
✦ Push
✦ Releasing your app
✦ Source Control
✦ Noti
fi
cations
✦ App Store Connect
11. Introduction to Fastlane
Code signing process is quite tough
What is code signing?
To ensure that there is no change is
introduced accidentally or by malicious code
- Certi
fi
cates: issued by Apple
- Development
- Distribution
- Provisioning pro
fi
les
- Development
- Adhoc
- Distribution
https://abhimuralidharan.medium.com/what-is-a-provisioning-pro
fi
le-in-ios-77987a7c54c2
12. Introduction to Fastlane
Code signing process is quite tough
What is code signing?
To ensure that there is no change is
introduced accidentally or by malicious code
- Certi
fi
cates: issued by Apple
- Development
- Distribution
- Provisioning pro
fi
les
- Development
- Adhoc
- Distribution
https://abhimuralidharan.medium.com/what-is-a-provisioning-pro
fi
le-in-ios-77987a7c54c2
13. Introduction to Fastlane
Match - A code signing solution
Keep certi
fi
cates and
provisioning pro
fi
les in a
central place
Pros:
- Everyone can use the same account
- Speedup the initial setup
- Friendly with CI servers and your local
PC as well
14. Introduction to Fastlane
Match - A code signing solution
Keep certi
fi
cates and
provisioning pro
fi
les in a
central place
Pros:
- Everyone can use the same account
- Speedup the initial setup
- Friendly with CI servers and your local
PC as well
15. Introduction to Fastlane
Match - Code signing solution
What match can do? Almost everything!
- Recreate provisioning pro
fi
les to
update new added devices
- Create new certi
fi
cates
- Clean up your developer portal -> be
careful with this
- Manage certi
fi
cates and pro
fi
les for
you
16. Introduction to Fastlane
Fastlane con
fi
guration
All the magics happen in this
fi
le
platform :ios do
desc "Dev: Preparing provisioning profiles and certificates"
lane :cert_dev do
perform_match("development", force_for_new_devices: true)
end
desc "Firebase Distribution for Beta-QA scheme"
lane :build_betaqa_firebase do
perform_match_for_build("adhoc")
increment_version
perform_build(configuration: "Beta-QA", method: "ad-hoc")
distribute_to_firebase(app: "APPID", credentials: “#{Dir.home}/.gcp/firebase-beta.json")
sendToSlack("All done! :tada:")
end
17. Introduction to Bitrise
The CI service created for mobile teams
Why Bitrise?
- The
fi
rst CI created for mobile development in mind
- Supports many development tools includes Fastlane
- Customize ability is pretty strong
- Free accounts can run up to 30 mins each build
18. Introduction to Bitrise
The CI service created for mobile teams
What Bitrise can do? It can do everything you can on your PC
- Manage certi
fi
cates & provisioning pro
fi
les for you too!
- Build the app using xcbuild directly or via Fastlane
- Cache pre-built frameworks
- Upload to builds to AppStore
- Send noti
fi
cation to Slack
- And many more…
20. Introduction to Bitrise
The CI service created for mobile teams
So why don’t we just use Bitrise?
Because all of the Bitrise features are not available on your local PC.
21. Bitrise Bot
Interact with Bitrise with a chat bot
- Bitrise has an API that allows you to trigger a new build
- What we can do:
- Create a Slack chat bot to handle mention messages
- Request messages from Slack are processed by a handler
deploys on a serverless service with a few lines of code
- Trigger requests will be sent from the handler function on your behalf
https://devcenter.bitrise.io/api/build-trigger/
24. Recap
- Rome for caching Carthage builds
- Match for managing certs & pro
fi
les
- Fastlane for build & archive
- Bitrise to create a ready to use environment to run Fastlane
- Slack & Serverless to control Bitrise via a interactive chat bot