Pgyer document center

Upload the App to PGYER Using Fastlane

Fastlane Introduction

Fastlane is an automated build tool for iOS and Android developers, It can help developers to package, sign, test, publish, organize information, submit App Store and other work to complete the connection, to achieve a fully automated workflow, if used properly, can significantly improve the development efficiency of developers.

To enable Fastlane users to integrate Fastlane's automated workflow with PGYER, we've made the PGYER plugin for Fastlane available. The plugin is very simple to use, and after installing the plugin, the App generated by Fastlane packaging can be automatically uploaded to PGYER.

Preconditions

  1. The developer uses a mac or linux system
  2. You have installed ruby, rubygems, and bundler
  3. Fastlane has been installed. If not installed, please refer to: the official installation guide
  4. Developers understand the basic App development process and terminal usage
  5. The application environment of this paper is: macOS 10.13, Xcode 9.2, fastlane 2.78.0, fastlane-plugin-pgyer 0.2.1

Install PGYER Fastlane plugin

In the terminal, enter the following command to install PGYER's fastlane plug-in.

fastlane add_plugin pgyer

Wait for a few seconds, if the following message appears, it indicates that the installation is successful:

! fastlane

Launch PGYER plugin in Fastlane

Before we can use Fastlane, we first need to initialize Fastlane in our project. First go to your App's development directory and execute the following command to initialize Fastlane:

fastlane init

After executing the above command, Fastlane will automatically generate the 'fastlane' directory in the App directory, which will have the Fastlane configuration file 'fastlane/Fastfile', here, we use vim to open:

vim ./fastlane/Fastfile

Then, we find the workflow (action) we are using and add the configuration information of the PGYER plugin after the build_app directive. For example:

lane :beta do build_app(export_method: "ad-hoc") pgyer(api_key: "7f15xxxxxxxxxxxxxxxxxx141") end

Attention:

  1. The above api_key please developers under their account application management - App overview - API can be found, and the replacement to the corresponding position of the above.
  2. In Xcode 8.3 and later versions, the value of 'build_app' 'export_method' needs to be set according to the developer's packaging type. The optional values are: 'app-store', 'ad-hoc', 'development', 'enterprise'. For versions of Xcode below 8.3, you do not need to set 'export_method'.

Package and automatically upload App to PGYER

With this configuration, you can use Fastlane to package your App and automatically upload it to PGYER. In the terminal, locate the project directory and enter the following command:

fastlane beta

In the case of success, you can see something like the following:

fastlane

Advanced usage

You can also set the password when the App is uploaded to PGYER:

lane :beta do build_app(export_method: "ad-hoc") pgyer(api_key: "7f15xxxxxxxxxxxxxxxxxx141", password: "123456", install_type: "2") end

Set the description for a version update:

lane :beta do build_app(export_method: "ad-hoc") pgyer(api_key: "7f15xxxxxxxxxxxxxxxxxx141", update_description: "update by fastlane") end

Error checking

  1. When an error occurs, first upgrade to the latest version of fastlane, Xcode, and Fastlane-plugin-pgyer plugins, and then try again;
  2. If the problem is Fastlane itself, try to uninstall Fastlane and reinstall it.