fastlane
With fastlane, you can automate beta deployments and releases for iOS and Android apps. fastlane handles all involved tasks, such as generating screenshots, code signing, and releasing the application.
On this page:
Get started
To set up fastlane, follow the instructions on how to install fastlane in the fastlane documentation.
Limitations
fastlane currently only runs on macOS.
Step-by-step instructions
The fastlane plugin for Perfecto allows you to automatically upload .ipa
/.apk
files to the Perfecto Media repository for testing of manual, automation, and developer tools in the Perfectocloud. It is available as a ruby gem here: https://rubygems.org/gems/fastlane-plugin-perfecto
To install the plugin:
- Make sure Ruby and fastlane are already installed.
-
Add the fastlane plugin to your project by running the following command:
Copyfastlane add_plugin perfecto
For information on using the fastlane plugin, see this example Fastfile. Following is a sample action that you can add to your Fastfile to utilize the plugin.
lane :test do
perfecto(
perfecto_cloudurl: ENV["PERFECTO_CLOUDURL"],
perfecto_token: ENV["PERFECTO_TOKEN"],
perfecto_media_location: ENV["PERFECTO_MEDIA_LOCATION"],
file_path: ENV['GRADLE_APK_OUTPUT_PATH']
)
end
where:
PERFECTO_CLOUDURL
is the URL of your Perfecto cloud, such as demo.perfectomobile.comPERFECTO_TOKEN
is your Perfecto security tokenPERFECTO_MEDIA_LOCATION
is the location of the Perfecto media repository to upload the file specified by thefile_path
key, such asPUBLIC:Samples/sample.ipa
-
file_path
is the location of your preferred.ipa
/.apk
file to be uploaded to the Perfecto media repositoryENV['GRADLE_APK_OUTPUT_PATH']
is only applicable to Android projects.
You pass the values for these keys either by means of an .env
file inside the fastlane
folder or through environment variables.
The following image shows a sample .env
file.
Combinations with other tools and integrations
You can use fastlane in combination with other tools and integrations that Perfecto offers. The following sample project demonstrates the usage of the fastlane plugin in an end-to-end integration of an Android build life cycle: https://github.com/PerfectoMobileSA/FastlaneEspressoCircleCISlackSample.
The life cycle includes:
- Generating the .apk builds
- Testing the builds on Perfecto
- Running the builds in CircleCI
- Getting instant, suite-level reporting to Slack
- Verifying the test results with Perfecto Smart Reporting
For steps, expand the following scenarios.
- Clone the sample project.
- In a terminal window, navigate to the project folder.
- Create a file called
local.properties
to contain ansdk.dir
key pointing to your Android SDK location. - Set up the
.env
file (see example above). -
Run the following commands:
Copyfastlane install_plugins
bundle exec fastlane android test
-
Set up CircleCI. Use this sample CircleCI fastlane file as a reference.
The
config.yml
file takes care of deploying the required installations, builds the.apk
files, uploads to Perfecto, executes Espresso tests in the Perfecto cloud, and then sends the suite-level Smart Reporting link to Slack. -
Set up the following environment variables in CircleCI. For more information, see the CircleCI documentation on environment variables.
-
PERFECTO_CLOUDURL
: The URL of your Perfecto cloud, such as demo.perfectomobile.com -
PERFECTO_TOKEN
: Your Perfecto security token -
PERFECTO_MEDIA_LOCATION
: The location of the Perfecto media repository to upload the file specified by thefile_path
key, such asPUBLIC:Samples/sample.apk
-
slack_webhook
: The incoming webhook for the Slack integrationFor more information, see the fastlane documentation on Slack.
-
The following image shows the Perfecto report in the CI Dashboard view.