SHASHIKANT JAGTAP
DevOps for iOS Apps
iOSDevUK Conference 2018
@Shashikant86
shashikantjagtap.net
#iOSDevOps
XCBlog (Medium, Apple News and DZone)
2
• iOS Development Challenges
• Basics of DevOps
• CI/CD Practices (YNAP)
• Speeding Up Swift Builds
• App Store Connect API
• DevOps Benefits for iOS
• Summary
TOPICS
3What are iOS Development Challenges?
4
Manual Releases are Pain
iOS Development Challenges
5
iOS Development Challenges
Lack of Build Automation
6iOS Development Challenges
CI/CD Setup is Hard
7iOS Development Challenges
Lack of Infrastructure Automation
8iOS Development Challenges
Immature Quality Assurance
9iOS Development Challenges
Pull Deployments
10Hello DevOps
Not tooling, Not a Role, It’s Culture
11DevOps Pillars
Systems Thinking Amplifying Feedback Loop
Continuous Learning & Experimentation
12DevOps Pillars for iOS
Jira, Slack, Agile
Swiftlint, Danger, XCTest, CI,
XCUITest, Sketch, Zeplin,
Apple Dev Tools, AppStore
Connect.
New Apple Frameworks & Tools. e.g CreateML, CoreML, App StoreConnect
13DevOps Engineer: Tools
Where is iOS Tooling Here?
Image Source: http://jgovernor-media.redmonk.com/jgovernor/files/2017/06/atlassian-marketplace.png
14
DevOps Practices
Collaborative
Development
Continuous
Integration &
Delivery (CI/
CD)
Infrastructure
As Code
Build, Test,
Release
Automation
Continuous
Testing
Continuous
Monitoring
15YNAP Tooling
Our Technology Stack at YNAP
16
Collaborative iOS Development
Pairing, Code Reviews, Common Architecture
17Collaborative iOS Development
GitHub Templates, Danger, Swiftlint
PR Templates & Codeowners Danger to detect issues
Automated Code Reviews with Danger - Swiftlint plugin
18Build, Test, Release Automation
xcodebuild, agvtool, altool, Fastlane tools
19YNAP - Build Automation
Archive App from TravisCI
Travis Build Matrix to
run parallel builds and
conditional archive
20
YNAP - Build Automation
Parallelising Builds and Tests
Parallelise Build using
Travis CI Build Matrix
21YNAP - Build Automation
Fastlane Slack Notification
Fastlane Slack Notification
22Infrastructure As Code
Bash, Ruby, Ansible, Chef
23Infrastructure As Code- YNAP
Travis, Danger, Pod Configuration in repo
24General iOS CI/CD Options
iOS CI/CD Options for Cloud and Self-Hosted
25YNAP-iOS CI/CD- YNAP
Travis CI handles Our CI/CD
26
iOS Continuous Testing-YNAP
Apple’s XCTest framework for all types of testing
27iOS Continuous Monitoring- YNAP
Crashlytics & Fabric for monitoring Apps
28Xcode 10 & Beyond…
What’s New?
29Speeding up Swift Builds- Tips
Swift Build Time
https://github.com/fastred/Optimizing-Swift-Build-Times
30Faster Swift Builds Xcode 10
Understanding Xcode Build Process
https://developer.apple.com/videos/play/wwdc2018/415/
31Faster Swift Builds Xcode 10
Use New Build System- XCBuild
32
Faster Swift Builds Xcode 10
Understand Build Process & Parallelised Builds
Parallelise
Builds
33
Faster Swift Builds Xcode 10
Improve Run Script Phase
34
Faster Swift Builds Xcode 10
Separate Compilation Mode & Optimization Level
35
Faster Swift Builds Xcode 10 - Tips
Some other things to consider with Xcode 10
Select right
Dependency
Manager
Add Implicit
Dependencies
Cache
Dependencies
Code
36
Faster Tests in Xcode 10
XCTest for Unit, Integration, Network, API, Performance Tests
KEEP IT
NATIVE
37
Faster Tests in Xcode 10
Parallelise Tests for speed
38
Speeding Tests - Tips
Limit UITest,
Maximise
Domain Layer
Tests
Find
right
tests
to run in parallel
Keep
Performance
Tests Separate
Bundle
Add
Accessibility
Identifiers
Separate Build Config
for Testing
Select
Powerful
CI
Mock or Stub
Smartly
39
Faster iOS Releases
Automate Build for Continuous Delivery to TestFlight
40
Speeding Releases- Tips
Never Release
from Local
Xcode. Automate
Releases
GitFlow or Trunk Based
Development
Select
Right CI
Server/
Service
Feature Flag
TestFlight
Regularly
Collaborate
with Backend
41
Native Apple Developer CLI Tools
xcodebuild:-
Analyse, Build,
Test and Archive.
Security : Manage
Keychain
PlistBuddy
agvtool
xcrun
tools:
simctl
xcode-select
altool
openssl
iTMS
Transporter
42
App Store Connect API
Talk to App Store Connect with API
https://developer.apple.com/videos/play/wwdc2018/303
43App Store Connect API
Manage Certificates, Profiles, Users, Apps, Sales etc
api.appstoreconnect.apple.com
44
Accessing App Store Connect API
JWT Tokens needs to be created after every 20 mins
Generate JWT Token
Generate API Key
Get Private Key
Access API using
JWT Token
GET api.appstoreconnect.apple.com/v1/users
45
What to Expect?
Be Prepared To Learn New Wrapper Tools
More tools will be there in
market. Written on top of App
Store Connect API
Existing tools will break.
Think before investing
46
Automate in Apple Way
Good Bye Third-Party Tools?
Finally, we got official API to talk to App Store Connect
47
Benefits of iOS DevOps
DevOps is Sense of Urgency
Boost iOS Developer Productivity – Let them Build Features,
not Infrastructure
Faster feedback on features from everyone – Fail Fast to
innovate Faster
Deliver before your competitors – Continuous Delivery of
Features
Shorten Mean Time To Recovery
48
Summary
It’s not too late. Enable DevOps in Your iOS Team Today
Common iOS Development problems
What is DevOps and how to solve common problems using DevOps
DevOps Practices and How to implement in iOS Projects
Tips and Tricks to Automate Swift (Build + Test + Release) Process
App Store Connect API
Benefits of DevOps for iOS Apps
@ynap
www.ynap.com
YOOX NET-A-PORTER GROUP
@Shashikant86
shashikantjagtap.net
About Me:
https://www.linkedin.com/in/shashikantjagtap
Tweet #iOSDevOps #iOSDevUK

iOSDevUK Conference- DevOps for iOS Apps