Now that fastlane is installed on your system, you can run the following:
fastlane init
This will create a folder in fastlane, with many files.
There is a fastlane Swift support in beta that will not be covered in this section. It features a Swift-based Fastfile.
We will focus on the Fastfile located in fastlane/Fastfile. It is in this file that you will declare all your lanes or actions.
Each action is a series of commands, written in Ruby; actions can depend on other actions or invoke plugins.
Now that the required files are created, you can create your first lane:
lane :test do
run_tests(scheme: " MyNewProjectTests",
devices: ["iPhone XR", "iPhone XS"])
end
To run this lane, use the following command:
$ fastlane test
You can then replace your .travis.yml configuration with this:
language: objective-c
osx_image: xcode10.1
install: bundle install
script: fastlane test
As you can see, the structure of the Travis configuration is tremendously simplified, as we moved all the logic into Fastfile.