I heard a long time ago about the convenience of automated packaging, but I haven't tried it. Recently, because of the project requirements, I have tried it myself. There are a lot of information about fastlane, how powerful the function is, automated testing, certificate management, screenshots and so on. But I only use the function of automated packaging here, after all, the best way for my project team is the way.
Install faltlane and initialize the project fastlane
Installation of faltlane is not mentioned, please refer to the official website. Portal
Enter the project project project and initialize fastlane
cd your project path
fastlane init
I don't know why, every time I come in with my company's computer, I get stuck, I can't turn over the wall, I can't change the source. If a little partner knows, please leave a message to me, but as long as the fastlane/Fastfile file is generated, it can still be operated after that.
gem sources
https://gems.ruby-china.org/
https://rubygems.org
- Add dandelion plug-in, after success, the fastlane folder appears Pluginfile file file
fastlane add_plugin pgyer
Write Fastfile, pack ad-hoc version and upload dandelion
- Write the Fastfile file, see the code
default_platform(:ios)
platform :ios do
desc "Upload to Dandelion"
# Usage method:
# 1. Enter the corresponding project and add the dandelion plug-in fastlane add_plugin pgyer
# 2. Run the packing command fastlane adhoc name:your_project_name
lane :adhoc do |options|
name = options[:name]
gym(
clean:true, # Whether to empty the previous compilation information true:
scheme: name, # Name of your own project
workspace: "#{name}.xcworkspace", # Your own project name, xcworkspace (generated using cocoapods)
export_method:"ad-hoc", #app-store,ad-hoc,enterprise,development
configuration:"AdHoc",
output_directory:"./fastlane/build", # Directory of packaged ipa files
export_xcargs: "-allowProvisioningUpdates", #Access key chain
output_name: "#{name}.ipa",# ipa file name
silent:true,#Hide unnecessary information
export_options: {
provisioningProfiles: {
"com.you.bundleIdentifier" => "your_AdHoc" # bundleid, certificate name for packaging
}
}
)
pgyer(
api_key: "your_apikey", # apikey obtained from the details of dandelion project
user_key: "userKey", # userkey from Dandelion Project Details
password: "123456", # Password
update_description: "Text description updated for this test"#"description" # Text description (parameter settings) updated for this test
)
end
end
- Usage method
Execute the command at the terminal entry project path: fastlane adhoc name:your_project_name
Before packaging, configure Version and Build versions in Xcode (plug-in is not used here, manual management), certificates should be configured correctly. App Store certificates have been matched here before, and packaging will be abnormal.
Pack up a successful upload prompt and receive an email or SMS reminder from dandelion.
falstlane packages and uploads App Store
I checked other people's blogs on the Internet before. Generally speaking, they can't be used directly. No way, I read the official documents, studied them, and explored a version of myself. Now I will record the course of my explorations.
Official documents say you need to use deliver y to upload App Store Official Port
- Step 1 Initialize deliver y into your own project project project
cd [your_project_folder]
fastlane deliver init
At this point, fastlane will let you enter the developer account and the Bundle Identifier of APP. If either Bundle Identifier or iTunes Store does not exist, deliver y will fail to initialize.
Create the corresponding APP ID and iTunes Store before initialization.
When initialization is complete, fastlane downloads the configuration information of APP in iTunes Store (if previously configured)
The results are as follows:
- Write Deliverfile files according to the description of official documents
To configure iTunes Store with Deliverfile file, you need to fill in configuration-related information (unknown information as compared with iTunes Store)
# The Deliverfile allows you to store various iTunes Connect metadata
# For more information, check out the docs
# https://docs.fastlane.tools/actions/deliver/
# Settings based on iTunes Store information
username "12345678@qq.com" # Apple ID email address
app_identifier("com.my.MyFastLaneDemo") # bundle identifier
#ipa("./fastlane/release_ipa/My.ipa") # Without this option, only metadata will be uploaded to the ipa path
copyright("Copyright Information 2018") #Copyright information
#submit_for_review(false) #Whether to submit audit or not, true means to submit audit immediately
screenshots_path("./fastlane/screenshots") # Screen capture picture display
price_tier 0 #app selling price
trade_representative_contact_information( #iTunes store Integrated Information Office
first_name: "jie", #name
last_name: "wang", #surname
address_line1: "Software Park", #address
address_line2: "",
address_line3: "",
city_name: "Chengdu", # City
state: "SICHUAN", # province
country: "China", #Country
postal_code: "610000", # Zip code
phone_number: "+86 18283606699", # Mobile phone
email_address: "2186682180@qq.com", #mailbox
)
app_review_information( # app Audit Information
first_name: "jie", # name
last_name: "wang", #surname
phone_number: "+86 18283606699", #Contact Information Telephone Number
email_address: "2186682180@qq.com", #Contact Information Mailbox
demo_user: "12345678", #Audit Test Account
demo_password: "1234", # Audit test password
notes: "Remarks information" # Notes on iTunes Store Audit Information
)
#Submit audit information: encryption, idfa, etc.
submission_information({ # Parameter reference address https://github.com/fastlane/fastlane/blob/master/spaceship/lib/spaceship/tunes/app_submission.rb
export_compliance_encryption_updated: false,
export_compliance_uses_encryption: false,
content_rights_contains_third_party_content: false,
add_id_info_uses_idfa: false
})
# Template reference address https://github.com/fastlane/fastlane/blob/master/delivery/assets/example_rating_config.json
app_rating_config_path "./fastlane/metadata/itunes_rating_config.json" #Age grading allocation
name({
'zh-Hans' => "MyFastLaneDemoTest" # app name
})
description({ #Description information in iTunes Store
'zh-Hans' => "APP Descriptive information,Be used for APP Description and introduction of functions should not be less than 10 characters"
})
release_notes({
'zh-Hans' => "First version test" #This new version information, the content to be filled in in the new iTunes Store content
})
keywords( # Contraction keywords
"zh-Hans" => "FastLane, Beauty"
)
promotional_text( # Introduction of Localized Propaganda Text Information
"zh-Hans" => "Introduction of Localized Propaganda Text Information",
)
support_url({ # Technical Support Website (URL)
'zh-Hans' => "http://www.baidu.com"
})
marketing_url({ #Marketing website
'zh-Hans' => "http://www.baidu.com"
})
privacy_url({
'zh-Hans' => "http://www.baidu.com"
})
app_icon('./fastlane/metadata/AppIcon.png') #Application icon 1024*1024
primary_category("Utilities") #Category Settings Reference Website https://docs.fastlane.tools/actions/upload_to_app_store/#reference
# primary_first_sub_category "Card"
# primary_second_sub_category "Casino"
# No secondary category to be set
# secondary_category
# No secondary first subcategory set
# secondary_first_sub_category
# No secondary subcategory set
# secondary_second_sub_category
automatic_release true #Automated release after audit
- Edit Fastfile file and write packaged release version code
default_platform(:ios)
platform :ios do
desc "Pack release Edition"
# Run the packaging command fastlane buile_release name:your project name
lane :buile_release do |options|
name = options[:name]
gym(
clean:true, # Whether to empty the previous compilation information true:
scheme: name, # Name of your own project
workspace: "#{name}.xcworkspace", # Your own project name, xcworkspace (generated using cocoapods)
export_method:"app-store", #app-store,ad-hoc,enterprise,development
configuration:"Release",
output_directory:"./fastlane/release_ipa", # Directory of packaged ipa files
export_xcargs: "-allowProvisioningUpdates", #Access key chain
output_name: "#{name}.ipa",# ipa file name
silent:true, #Hide unnecessary information
include_bitcode: true,
export_options: {
provisioningProfiles: {
"com.you.bundleIdentifier" => "your_appStore" # bundleid, the name of the certificate used for packaging, can also be passed here by parameters, depending on personal preferences
}
}
)
end
desc "Upload to App Store"
lane :upload do |options|
deliver( #Submit App Store Audit
ipa:"./fastlane/release_ipa/#{options[:name]}.ipa", #ipa path
force : false, #Whether to skip page review or not, a preview interface will be formed during uploading.
submit_for_review(true) #Upload successfully and submit for review immediately
)
end
# Use method fastlane build_upload name:your project name
desc "build relese ipa and upload to App Store"
lane :build_upload do |options|
buile_release(options)
upload(options) #Submit App Store Audit
end
end
- Usage: Get into Project Engineering
fastlane build_upload name:your project name
- Demonstration effect