Develop new function at ordinary times, often need to submit a test package to fir, and then to the test personnel to install, each release will have to change the configuration, the clean cache, is a very complicated thing, a little bit do not pay attention to may choose the wrong description file, the version number, and so on Ever seen someone with automation tools, there has been no attempt application, Just these two days released a new version, time more ample, began to deploy automation tools.

The Fastlane command is a process control command line tool (CLI) that integrates actions internally with third-party actions to complete a series of control processes. Running the Fastlane command line tool reads the Fastfile configuration file in the current directory or in the./fastlane directory.

The installation

Make sure the latest version of Xcode Command Line Tools is installed

xcode-select --install

If you have installed Ruby separately (if you can read this sentence), remove sudo. [sudo] gem install Fastlane

Initialize the

Go to the project root directory

fastlane init

After asking your Apple ID and Team questions, Fastlane will automatically detect the App Name and App Identifier of the project in the current directory. If not, select N and input it yourself.

You can also omit your Apple ID

You will then be asked if the app needs to be created in iTC and ADC (if you select Y in the previous step, it will automatically detect if it needs to be created), and Fastlane will call Produce to initialize it. If you don’t want to create it now, you can run Produce Init later. If the produce process is not executed, the Deliver process will be skipped, but you can run the exact same process later with Deliver Init.

During the execution of deliver Init, metadata and screenshots for all languages in the iTC are synchronized and organized in a directory structure.

The ones that will definitely be created here are Appfile and Fastfile.

Fastfile => is used to define all lane tasks. Fastfile help Appfile => is used to store common information such as app_identifier, apple_id, team_id, ITC_team_id, etc. Appfile Help Deliverfile => Deliver Configuration file Deliverfile help

The plug-in

Fastlane plug-ins are packages of one or a group of actions that are published separately from Fastlane.

You can view all the plug-ins here

fastlane search_plugins

I used only two fastlane-plugin-versioning fastlane-plugin-firim plugins here

  • fastlane-plugin-versioning

Used to change the build version number and version version number

The actionIncrement_build_number embedded in Fastlane uses the Agvtool provided by Apple, which changes the version numbers of all targets when changing builds. If you have more than one product in a project, every time you compile, all builds increase by 1, and you end up with no idea where the height is.

With Fastlane-plugin-versioning, you can not only specify the target to add Build, but you can also add Version according to the “semantic Version” specification, or you can set Version directly.

  • **fastlane-plugin-firim **

Upload ipa packaged by AdHoc or InHouse directly to fir. Im for test download.

Install the above plug-in

fastlane add_plugin versioning

fastlane add_plugin firim

configuration

With Fastfile, you can add your own publishing process. Open the Fastfile file (here I set the syntax to Ruby using Sublime).

Gym

Gym is a common configuration item

Name Type Description Default
scheme string Specify the scheme to compile
clean bool Whether to clean before compilation false
output_directory string Export directory . /
output_name string Export the IPA name [app_name].ipa
export_options hash/string This specifies the external configuration file address of the Xcode API, or configures the hash, as shown below
export_method string Package mode, optional app-Store ad-hoc Package Enterprise Development developer-ID If you use Sigh in Fastlane, this value is retrieved from the context
include_bitcode bool Whether to enable bitcode The Xcode API defaults to true
include_symbols bool Whether to generate a symbol table The Xcode API defaults to true

After Xcode7, the Xcode API allows us to specify a plist file as an additional configuration file. Gym creates this file for you by default and you can specify the configuration directly. For more information about plist configurable items, run xcodebuild-help to see Available keys for -exportOptionsplist. The parameters export_method, include_symbols, and include_bitcode are all exportOptionsPlist configurations, corresponding to method, uploadSymbols, and uploadBitcode.

When you manually enter the build, you need to include the Current Project Version key in the Project file. Otherwise, an error message will be displayed when you run the command, and the build cannot be used

use

Fastlane uploadTo_firim version: 3.0.0 build: 45

Version is the version number of this package. Build is the build number of this package

Press Enter and it starts packing