XCBook-iOS DevOps

XCTEQ is in the process of writing books on iOS DevOps which cover almost everything to deliver the quality app to AppStore. If you are interested in this book, please read the book content and tweet this book.

iOS DevOps Book

The complete book which covers automation of Build, Test and Deployments for iOS apps. The book cover will look like this



XCTEQ is in the process of writing a book on iOS DevOps. The complete book which covers automation of Build, Test and Deployments for iOS apps.

This book is aimed to solve the challenges of iOS development by applying practical Mobile DevOps and Continuous Delivery techniques. This book will help your iOS team to automate the entire release process of iOS apps including analysing, building, testing, achieving and distribution to App Store. You will also learn about dealing complex iOS development tasks like Apple development certificates, provisioning-profiles, code signing and distribution to AppStore Connect. This books also covers popular package managers in iOS and how to choose select right package manager for your iOS app. We will also cover the detailed process of iOS Continuous Integration a.k.a CI and how to setup Continuous Integration for your iOS apps.

In short, this book covers everything you need to deploy iOS apps once it’s ready. Most of the iOS developer, project managers or other people involved in iOS app development consider these activities are secondary as the focus is on writing the code to develop features. However, setting up an infrastructure for deploying iOS apps is time-consuming, risky and critical for deploying iOS apps to end users. When risks surrounding these areas are not managed well, they can end up costing more than building the iOS app in the first place. Traditionally iOS developers are good in writing Swift or Objective-C code but they the don’t have skills for setting up infrastructure, automate build and create all sort of tooling to deliver iOS apps smoothly.


What This Book Covers

The target audience for this book is the iOS Developers all around the world. They might be having different skill sets so not everyone will want to read this book end to end but it would be good to go sequentially and skip chapters that you already know about. Once the basics are covered then you can attack different part needed for your current context. This book is divided into six main parts. The first part, Chapters 1 to 3 takes you through principles of Mobile DevOps and Continuous Delivery to ease the pain of iOS releases. Part 2, Chapter 4 and 8 covers iOS package managers and techniques to select right package manager for iOS app. Part 3, Chapter 9 through 16 is the core of this book which covers practical demonstration of automating iOS Deployment. Part 4, Chapter 17-22 is also important as it covers setting up Continuous Integration for iOS apps and techniques to manage CI servers. Part 5, Chapter 23 to 26 covers complex topics like iOS Code Signing and AppStore Connect. This will also explore AppStore Connect API announced by Apple. Finally, we got Part 6, Chapter 27-32 on Xcode UI Testing, different iOS testing topics like Behaviour Driven Development, Performance testing and XCUITest on CI. This also covers some tips and tricks of automating UI tests. You can attack any part of this book as required.

Part 1 – Basics of Continuous Delivery and Mobile DevOps

This part describes how practices like Mobile DevOps and Continuous Delivery help to ease the pain of iOS releases. This will cover basics general concepts of DevOps and Continuous delivery applied to iOS

Chapter 1, “Painful iOS Releases” starts by some common challenges that we see in the iOS development teams. We conclude by setting out the processes like continuous delivery upon which this book is about.

Chapter 2, “DevOps and Continuous Delivery” outlines general concepts of DevOps and Continuous Delivery that are currently being used in the IT industry for deploying applications. This chapter also covers benefits of adopting DevOps and Continuous Delivery practices.

Chapter 3, “ iOS: Mobile DevOps” highlights different between traditional DevOps and Mobile DevOps. This chapter also explains unique challenges of mobile deployment for iOS apps and why we need DevOps for iOS apps.

Part 2 – iOS Package Managers 

This part explains the project structure of iOS apps and basic concepts of iOS development including Xcode project, build sets, targets, schemes etc. The main goal of this chapter is to understand the concept of package managers. We will create a sample app in this section that can be used throughout the book later and add example packages using existing package managers like CocoaPods, Cartage and Swift package Manager. 

Chapter 4, “iOS Xcode Project Structure” gives a basic overview of an iOS application by creating sample app in Xcode and understanding concepts like targets, schemes, build phases and build settings.

Chapter 5, “CocoaPods”, covers the most popular iOS package manager. This chapter will cover basics of CocoaPods and using CocoaPods in iOS apps. We will also cover internals of CocoaPods and how CocoPods affect Xcode project. 

Chapter 6, “Carthage”, covers the another popular iOS package manager which is Carthage. This chapter will cover basics of Cartage and using Carthage in iOS apps. We will also cover steps involved in the setting up Carthage for iOS app with example app. 

Chapter 7, “Swift Package Manager” gives an overview of Swift Package manager with detailed examples. Currently Swift Package Manager doesn’t officially support iOS but it will be in the future. We will cover the basic working of Swift Package Manager using example library. 

Chapter 8 “Selecting right Package Manager” covers the tips to select the right package manager for iOS app. We will explore what are the pros and cons of each package manager and evaluate the criteria for selecting right package manager.

Part 3 – iOS Deployment Pipeline

This part of the book is one of the biggest as it covers automation of entire iOS deployment pipeline. Starting from iOS package managers, we will cover some important Apple command line developer tools. We will also cover popular iOS Continuous Delivery tool Fastlane which is being used for many iOS projects at the moment.

Chapter 9, “Command Line Apple Developer Tools” introduces useful command line tools provided by Apple for scripting iOS development tasks. We will cover tools like xcodebuild, xcrun, Xcode-select etc

Chapter 10, “Fastlane Tools” covers the basic introduction to Fastlane and various Fastlane tools that can be used for automating iOS development tasks. We will also cover the little bit of Ruby and RubyGems setup to manage Fastlane tools inside iOS apps.

Chapter 11, “Automating Code Analysis” discusses the ways of automating static code analysis using open source tools like SwiftLint. We will cover how to setup and use SwiftLint on the local machine as well on Continuous Integration server to ensure the quality of Swift coding syntax. This chapter will also cover other tools like Danger to make Swift code reviews better. 

Chapter 12, “Automating Test” discusses why the XCTest framework from Apple is the best choice for the unit and UI testing of iOS app. This chapter will also cover how to automate XCTest using xcodebuid and Fastlane Scan tool. We will have cover how to write XCTest and XCUITest for iOS app in the separate section. 

Chapter 13, “Automating Adhoc and Release Builds” covers the practical approach to archive ad-hoc and release iOS builds using xcodebuild as well as Fastlane Gym tool. This chapter will also cover ways to host generated binaries and system files.

Chapter 14, “Automating iOS App Distribution” presents the ways to distribute iOS apps to different platforms like Fabric or TestFlight using Apple command line developer tools and Fastlane pilot tool.

Chapter 15, “Managing Build Train and Releases” sets out practices to manage build train in the current version and automate releases on GitHub or similar source control.

Chapter 16, “iOS Pipeline As a Code” discusses the approach of putting the automated build phases in the right order to form a pipeline for the iOS deployment. We will cover some of the provisioning tools like Chef, Ansible that can be used to automate all the iOS infrastructure. 

Part 4: iOS Continuous Integration

Chapter 17, ‘iOS Continuous Integration’ gives an overview of the Continuous Integration for iOS which covers both self-hosted and cloud based CI options. This chapter will also cover some tips to select right Continuous Integration server and why it’s important for any iOS project.

Chapter 18, “Implementing CI/CD with Xcode Server”, presents Continuous Integration Service from Apple for iOS apps. This chapter shows end to end process of setting up Xcode Server Continuous Integration for any iOS app with detailed architecture.

Chapter 19, “Implementing CI/CD with TeamCity”, shows end to end process of setting up TeamCity Continuous Integration for any iOS app with its pros and cons.

Chapter 20, “Implementing CI/CD with Jenkins”, shows end to end process of setting up Jenkins Continuous Integration for any iOS app with its pros and cons.

Chapter 21, “Implementing CI/CD with Cloud Based CI Services”, demonstrate setting up cloud based CI server for iOS Continuous Integration and Deployment. This chapter will also cover how the cloud base CI server differs from self-hosted CI servers. We will demonstrate some of the popular iOS cloud based CI services like TravisCI, CircleCI, BuddyBuild, Bitrise and Nevercode. 

Chapter 22, “Managing Self-Hosted CI Servers” discusses the configuration management tools like Ansible that can be used for provisioning and manage iOS CI servers.

Part 5: iOS Code Signing & AppStore Connect 

Chapter 23, “Code Singing” covers code signing of iOS apps in details. This chapter will cover various aspects of automated and manual code signing of iOS apps as well as iOS app extensions. We will cover basics of iOS code signing from creating certificates till code signing iOS apps with correct provisioning profiles. 

Chapter 24, “TestFlight and AppStore Connect” covers how to make use of TestFlight and AppStore Connects features efficiently for iOS Continuous Delivery. This chapter will discuss multi-build features of TestFlight and Phased releases features of ApStore Connects.  

Chapter 25 “AppStore Connect API” covers the basics of the AppStore Connect API that has been announced by Apple at WWDC 2018. This chapter will explore AppStore Connect APU using an example App and covers JWT token generation process to access API

Chapter 26, “Monitoring iOS Apps” discusses various options of monitoring iOS app once it’s been released. This chapter covers various tools like Crashlytics, AppDynamics and other feature flagging mechanisms.

Part 6: Xcode UI Testing (XCUITest)

Chapter 27, “Getting Started with XCUITest” discusses how the XCUITest are architecturally different from unit tests. We will also cover how to add UITest target to existing iOS apps and setting up required configuration for UITests.

Chapter 28, “Writing XCUITest” discusses how the write XCUITests using the API provided by Apple. We will explore XCUIElement, XCUIElementQuery and XCUIApplication API and explore mostly used methods in test automation.

Chapter 29, ‘BDD Architecture for XCUITest” discusses BDD style approach applied to iOS Development using XCUITest tool. This chapter also covers various options available for BDD style testing for iOS apps including protocol oriented BDD. This chapter will also discusses steps to organise XCUITests for both iPhone and iPad orientation without duplicating configuration or code. We will also cover some of the stubbing or mocking options for XCUITests. 

Chapter 30, ‘Setting up XCUITests on Continuous Integration Server ” discusses steps to setup Continuous Integration for XCUITests. This chapter will explore the native xcodebuild and Fastlane way to automate the XCUITests for CI build. This chapter also cover how to make XCUITest CI friendly. 

Chapter 31, ‘Performance Testing with XCTest’ covers the process of continuous performance testing using XCTest framework. This chapter also discusses benefits of performance testing of an iOS app.

Chapter 32, “Tips for Scalable XCUITests”, discusses various tips and tricks to make XCUITests more scalable and maintainable.

This will be the tentative structure of our book and might change as we go on writing. Please let us know if we miss something to cover in this book, we will happy to cover anything about DevOps, CI/CD or Test Automation in this book.