All the previous projects used FIR, for which I wrote an article about the use of FIR. However, when CONFIGURING FIR and using it recently, I found that FIR was about to expire, so I recommend using gym of Fastlane to compile. To that end, here’s how Fastlane is used.

Part I: Fastlane Installation

  1. First check to see if Ruby is installed
Allisondemacbook-pro :~ Allison $Ruby -v Ruby 2.3.3P222 (2016-11-21 Revision 56859) [universal.x86_64-darwin17]Copy the code
  1. Check: Make sure you have the latest Xcode command-line tools installed
allisondeMacBook-Pro:~ allison$ xcode-select --install
Copy the code

If not, the terminal will start installation, as shown in Figure 1:

allisondeMacBook-Pro:~ allison$ sudo gem install fastlane Password: Fetching: Gem (100%) Successfully installed Slacking -notifier-2.3.2. Gem (100%)...... Installing ri documentationforFastlane - 2.95.0 55 gems installedCopy the code

After a while, Fastlane will be installed.

Part TWO: Usage

1) CD to your own project directory and execute fastlane init.

[14:48:40]: We recommend automating one task first, and then gradually automating more over time [14:48:40]: What would you like to use fastlane for?

  1. 📸 Automate screenshots
  2. 👩‍✈️ Automate beta distribution to TestFlight
  3. 🚀 Automate App Store distribution
  4. 🛠 Manual setup – Manually setup your project to automate your tasks?

These four options mean 1. Automatic screenshots. This feature can help us to automatically capture the screenshots in the APP and add the border of the phone (if necessary). We don’t select this option here, because our project already has pictures, so we don’t need to take screenshots here.

2. Automatically release beta versions for TestFlight. If you don’t know TestFlight, check out this article by Wei Wang

3. Automatic App Store release packages. Our goal is to submit the audit to the APP Store, which should be chosen by reason, but we will not choose it now, because it will take some time to enter the user name and password and download meta information, and we can configure these data later.

4. Set the parameters manually.

Here I select the fourth one and press Enter to see the project directory that generated our Fastlane directory. (If the first operation, this process is a bit long, need to wait patiently)

2) After initialization, the project directory has an extra folder: Fastlane, as shown in Figure 2

fastlane add_plugin pgyer

Allisondemacbook-pro :AutoPackingDemo allison$fastlane add_plugin pgyer [configure] 🚀 [15:18:58]: Fastlane detected a Gemfilein the current directory
[15:18:58]: however it seems like you don't use `bundle exec`
[15:18:58]: to launch fastlane faster, please use
......
Installing plugin dependencies...
Successfully installed plugins

Copy the code

4) Open the FastFile file and configure it

default_platform(:ios)

platform :ios do
  desc "Description of what the lane does"
  lane :beta do
    # add actions here: https://docs.fastlane.tools/actions
      build_app(export_method: "ad-hoc")
  	  pgyer(api_key: "f4xxxxxxxxxxxxxxxxxxxxxx", user_key: "365xxxxxxxxxxxxxxxxxxxxxxx")
  end
end
Copy the code

You should correctly fill in the API_key and user_key of your dandelion account.

5) Package and automatically upload App to Dandelion. Under the terminal, locate the project directory and enter the following command:

allisondeMacBook-Pro:AutoPackingDemo allison$ fastlane beta

Copy the code

In the case of success, you see information similar to the following

So far, dandelion and local have IPA packages.