1. Preparation

1. Use Homebrew to install the Fastlane Homebrew official website and run the following command:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Copy the code

The following problems occurred in the installation process. The consultation is due to the network problems of CN, and Google has provided some solutions.

Some solutions

Query the url to be accessed host to be configured

Homebrew has been installed successfully.

2. Install the dandelion plug-in

Guide to the PGYER plug-in

At present, only this step has not been completed, all the other steps are in line.

Xcode command line tool installation

xcode-select --install
Copy the code

Only the test package was sent, so when I selected FastLAN, I selected item 4

3. Precautions

To run this command, run the CD command in the target project file directory.

fastlane add_plugin pgyer
Copy the code
fastlane init
Copy the code

Replace the script file Fastfile

These files need to be ignored in Git and cannot be committed. The script reference

# This file contains the fastlane.tools configuration # You can find the documentation at https://docs.fastlane.tools # # For a list of all available actions, check out # # https://docs.fastlane.tools/actions # # For a list of all available plugins, check out # # https://docs.fastlane.tools/plugins/available-plugins # # Uncomment the line if you want fastlane to Automatically update itself # update_fastlane default_platform(:ios) # public Settings macro SCHEME = "XXX" # EXPORT_METHOD = "Ad-hoc" #ad-hoc development enterprise OUTPUT_PREFIX = "XXX" # AD hoc development enterprise OUTPUT_DIR = "./build/" # package output directory # elion APP_KEY = "" USER_KEY = "" platform :ios do lane :test do gym(scheme: "#{SCHEME}", export_method:"#{EXPORT_METHOD}", output_name:"#{OUTPUT_PREFIX}Test.ipa", output_directory:"#{OUTPUT_DIR}", configuration: "Test", ) pgyer(api_key: "#{APP_KEY}", user_key: "#{USER_KEY}") end lane :pre do gym( scheme: "#{SCHEME}", export_method:"#{EXPORT_METHOD}", output_name:"#{OUTPUT_PREFIX}pre.ipa", output_directory:"#{OUTPUT_DIR}", configuration: "PRETEST", ) pgyer(api_key: "#{APP_KEY}", user_key: Lane :release do gym(scheme: "#{SCHEME}", export_method:"#{EXPORT_METHOD}", output_name:"#{OUTPUT_PREFIX}.ipa", output_directory:"#{OUTPUT_DIR}", configuration:"Release", ) pgyer(api_key: "#{APP_KEY}", user_key: "#{USER_KEY}") end endCopy the code

Perform:

fastlane test
Copy the code

Pgy download can be opened successfully