- You have 1 week to develop a feature.
- This feature will use all time, 1 week is too short.
- After finish each task, you need deploy a version to QA.
- After finish all feature, you need deploy a beta version to users.
To deploy a version to QA, you need delivery via Crashlytics .
To deploy a Beta version, you need delivery via TestFlight.
Crashlytics: 10 minutes archiving the project + 5 minutes uploading + 3 minutes selecting options and testers;
TestFlight: 10 minutes archiving the project + 15 minutes uploading + 5 minutes selecting options and testers;
Now, think that you need deploy 3 QA versions and 1 BETA version. This represents 84 minutes!
Now, remember that you need run your UI/Unit tests, if your tests need 5 minutes to run and you need run this 1 times per day, will represent 35 minutes.
You will spent about 2 hours just waiting!
- You need finish a feature and delivery for users that will install the app tomorrow 11 AM.
- It’s 11 PM, you need to sleep, you are very very tired.
- After finish, you need deploy a version to TestFlight;
- Deploy to TestFlight takes 45 minutes.
Now think, after finish the feature, you will need wait 45 minutes looking to your display, just waiting, and you are very tired! Of course, you’ll get it asleep.
First, we need to automatize the arquive and delivery process. We will use Fastlane.
Fastlane turn your process more easy and fast. With only one command line you can deploy all your application.
- Install fastlane
Install fast lane using:
# Using RubyGems sudo gem install fastlane -NV # Alternatively using Homebrew brew cask install fastlane
- Setting up fastlane
Navigate your terminal to your project’s directory and run:
When you run this command, will be prompt some options, just select what you like.
- Looking Fastlane folder:
- Custom your Fastfile
Open the Fastfile and create your custom lanes. Look this example:
desc "Deploy a new version to the App Store" lane :release do # match(type: "appstore") # snapshot ENV["BUNDLE"] = "com.nam.AppDemo" cocoapods( clean: true, podfile: "Podfile" ) changelog = File.read("Changelog.txt") #increment_build_number gym( export_xcargs: "-allowProvisioningUpdates", scheme: "AppDemo" ) deliver(force: true) end
All options can be found at documentation: https://docs.fastlane.tools/
That’s it, fastlane will deploy your application.
BUT we still have a problem, I can run with just one command line, but I need wait while my Mac runs it.
The next step: CLOUD!!!
Now, we need run the deploy process without use my local computer…
- Create a free account: https://www.bitrise.io/;
- Link your git account;
- Click in button Add New App;
- Select your repository;
- Choose the branch that contains the fastlane setup;
- Select fastlane as build type;
Your first build will fail because the code sign is not setup yet.
Let’s setup code sign:
- Open your app on Bitrise;
- Click in WorkFlow tab;
- Go to tap Code Signing
- Follow the steps How to setup Code Sign
If you use fastlane match, you don’t need setup the code sign.
Additionally you can Add workflows (you will need one workflow per lane).
You can setup Environment Variables, Secrets and more.
The magic starts when your
git push start your deploy process!!!
Just setup the triggers:
You can run your tests automatically when you push your code!
Now your beta deploy, qa deploy and tests will run automatically, and you win more than 2 hours per week.