当前位置:网站首页>Fastlane one click package / release app - usage record and stepping on pit
Fastlane one click package / release app - usage record and stepping on pit
2022-07-04 12:36:00 【iOSTianNan】
I'm free recently , Do something about it fastlane One click package release App store / testflight / fir.com
Related information
install fastlanebrew install fastlane
fastlane Installation and use
Fastlane Official documents
fastlane Automated packaging (android)
fastlane - fastfile Some basics
idea Use vs code , Some code snippet plug-ins can be installed , Quick start
How to transmit reference
The method of biographical reference writing
desc "Add description of lane"
lane :test1 do |options|
puts(options[:arg1])
puts(options[:arg2])
puts(options[:arg3])
end
Command line call
fastlane test1 arg1:a arg2:b arg3:c
Log output
[]
[14:33:30]: ------------------------------
[14:33:30]: --- Step: default_platform ---
[14:33:30]: ------------------------------
[14:33:30]: Driving the lane 'ios test1'
[14:33:30]: a
[14:33:30]: b
[14:33:30]: c
+------+------------------+-------------+
| fastlane summary |
+------+------------------+-------------+
| Step | Action | Time (in s) |
+------+------------------+-------------+
| 1 | default_platform | 0 |
+------+------------------+-------------+
[14:33:30]: fastlane.tools finished successfully
issuer_id
This must be the master account to see
If the prompt cannot be found p8 file, Remember to check the path , To be in fastlane Under the path , If it is
./
route , Will report a mistake
key_filepath: ‘./fastlane/AuXXXX.p8’,
app_store_connect_api_key(
key_id: "D83848D23",
issuer_id: "227b0bbf-ada8-458c-9d62-3d8022b7d07f",
key_filepath: "D83848D23.p8",
duration: 200,
in_house: true
)
iOS End step ( By default, the environment has been configured )
1.cd ios
2.fastlane init
3. To write Fastfile file
4. .p8 File put in ./fastlane File directory
5. Fastfile The document code is as follows
# 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)
platform :ios do
desc "test"
lane :test do |options|
#add actions here
puts(Dir.pwd)
puts("test ----> 1")
end
desc " pack iOS+ Upload "
lane :app do |options|
# Data variable section
targetName = "channelMarketing"
scheme = targetName
fastlane = "fastlane"
ipa = "ipa"
workspace = targetName+".xcworkspace"
workspace_path = './'+workspace
output_directory = './'+fastlane+"/"+ipa
output_name = targetName + ".ipa"
# Self increasing build Version number
increment_build_number()
gym(
clean:true, # Before packing clean once
workspace:workspace,
configuration:'Release',
scheme:scheme,
silent:false, # Hide all information you don't need when building Default false
output_directory:output_directory,
output_name:output_name,
include_symbols:true,
export_method: 'app-store', # app-store | ad-hoc | development etc.
export_xcargs: '-allowProvisioningUpdates'
)
# obtain ipa route
ipa_file_path = lane_context[SharedValues::IPA_OUTPUT_PATH]
# obtain ipa essential information
app_name = get_ipa_info_plist_value(ipa: ipa_file_path, key: "CFBundleDisplayName")
package_name = get_ipa_info_plist_value(ipa: ipa_file_path, key: "CFBundleIdentifier")
version_name = get_ipa_info_plist_value(ipa: ipa_file_path, key: "CFBundleShortVersionString")
version_code = get_ipa_info_plist_value(ipa: ipa_file_path, key: "CFBundleVersion")
puts("iPA essential information : app_name = " + app_name);
puts("iPA essential information : package_name = " + package_name);
puts("iPA essential information : version_name = " + version_name);
puts("iPA essential information : version_code = " + version_code);
# A copy of ipa + Modify and copy files Package name
sh("open ./ipa")
changeName_cp = "cp"
changeName_file_org = "./"+ipa+"/"+output_name
changeName_file_new = "./"+ipa+"/"+targetName+"_"+version_name+"_"+version_code+".ipa";
sh(changeName_cp +" "+ changeName_file_org +" "+ changeName_file_new)
# 3. Upload
api_key = app_store_connect_api_key(
key_id: 'xxxxxxx',# Self configuring
issuer_id: 'xxxxxxx',# Self configuring
key_filepath: './fastlane/xxxxxx.p8', # Self configuring
duration: 1200,
in_house: false
)
# Upload to testflight
upload_to_testflight(
# The authorization information set above
api_key: api_key,
skip_waiting_for_build_processing: true,
# Pack the files to upload
ipa: ipa_file_path,
skip_submission: true
)
end
# Submit a git
after_each do |lane, options|
# ...
puts(Dir.pwd)
# Submit changes build Number
sh("cd .. && cd .. && git add . && git commit -m -a")
end
end
android End step ( By default, the environment has been configured )
1.cd ios
2.fastlane init
3. Install some plugins
fastlane add_plugin firim
Some pits for installing plug-ins
Step on the pit 1:
Step on the pit 2 Upload fir.im
But the use of fastlane Plug in for fir-im, Here I use fir-cli, Go directly and upload the script ,
Direct use fir-cli Command line tools provided
stay lane Add You can upload
sh "fir publish xxxxx your apk file xxxxxxx -T xxxxxxxxyou tokenxxxxxxxx"
Of course, there are also stepping pits for installing plug-ins , Mainly because Gemfile The problem of file path
Androgan directory Gemfile And fastlane At the same level
Could not find gem 'fir' in any of the gem sources listed in your Gemfile.
Report errors :
Because I am Android Created under the root directory of the project fastlane init therefore ,Gemfile In the document plugins_path
Pay attention to the access path
primary Gemfile File pair plugins_path
The path is written as :
plugins_path = File.join(File.dirname(__FILE__), '.', 'Pluginfile')
eval_gemfile(plugins_path) if File.exist?(plugins_path)
Change here to :
plugins_path = File.join(File.dirname(__FILE__), 'fastlane', 'Pluginfile')
eval_gemfile(plugins_path) if File.exist?(plugins_path)
fir.im:80
Report errors :
In case of this error , Mainly still fir-cli The version of is too low , After the new version is upgraded, the new domain name is replaced
fir.im Change the domain name to betaqr.com after , Need to upgrade to fir-cli >= 2.0.4 Some users have feedback 2.0.2 Cannot be used directly gem update fir-cli Upgrade to 2.0.4, You can try to uninstall and reinstall , namely gem uninstall fir-cli after gem install fir-cli
Step on the pit 3: lane In the implementation of sh "fir version" Failure
can't find executable fir for gem fir-cli. fir-cli is not currently included in the bundle, perhaps you meant to add it to your Gemfile? (Gem::Exception)
The problem is Gemfile in , Make sure there are
gem "fastlane"
gem "fir"
Fastfile file :
# 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(:android)
platform :android do
desc "package"
lane :app do |options|
gradle(
task: 'assemble',
build_type: 'Release',
properties: {
"android.injected.signing.store.file" => Dir.pwd + "/xxxxx",
"android.injected.signing.store.password" => "xxxxxxxx",
"android.injected.signing.key.alias" => "xxxxxx",
"android.injected.signing.key.password" => "xxxxxxxx",
},
);
end
after_each do |lane, options|
# ...
apk_name = "xxxxxx.apk"
apk_path = Dir.pwd+"/"+apk_name
fir_token = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
apk_file_path = lane_context[SharedValues::GRADLE_APK_OUTPUT_PATH];
build_type = lane_context[SharedValues::GRADLE_BUILD_TYPE];
sh("cp #{
apk_file_path} #{
apk_path}")
sh("fir version")
sh("fir login #{
fir_token}")
sh "fir me"
sh "fir publish #{
apk_path}"
sh("open .")
end
end
边栏推荐
- . Does net 4 have a built-in JSON serializer / deserializer- Does . NET 4 have a built-in JSON serializer/deserializer?
- Anti clockwise rotation method of event arrangement -- PHP implementation
- C语言数组
- Abnormal mode of ARM processor
- Talk about "in C language"
- Awk getting started to proficient series - awk quick start
- 'using an alias column in the where clause in PostgreSQL' - using an alias column in the where clause in PostgreSQL
- Flet教程之 02 ElevatedButton高级功能(教程含源码)(教程含源码)
- Global and Chinese market of cardiac monitoring 2022-2028: Research Report on technology, participants, trends, market size and share
- The solution of permission denied
猜你喜欢
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 17
Clion configuration of opencv
Ml and NLP are still developing rapidly in 2021. Deepmind scientists recently summarized 15 bright research directions in the past year. Come and see which direction is suitable for your new pit
Fastlane 一键打包/发布APP - 使用记录及踩坑
Leetcode: 408 sliding window median
【数据聚类】第四章第一节3:DBSCAN性能分析、优缺点和参数选择方法
R语言--readr包读写数据
ASP. Net razor – introduction to VB loops and arrays
[solve the error of this pointing in the applet] SetData of undefined
IPv6 experiment
随机推荐
The most robust financial products in 2022
Single spa, Qiankun, Friday access practice
DVC use case (VI): Data Registry
Global and Chinese market for naval vessel maintenance 2022-2028: Research Report on technology, participants, trends, market size and share
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 8
Globalsign's SSL certificate products
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 7
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 6
Paper notes ACL 2020 improving event detection via open domain trigger knowledge
C language memory layout
Exness: positive I win, negative you lose
[Chongqing Guangdong education] National Open University spring 2019 2727 tax basis reference questions
Review of week 278 of leetcode II
Lecture 9
13、 C window form technology and basic controls (3)
Anti clockwise rotation method of event arrangement -- PHP implementation
Global and Chinese market of ice water machines 2022-2028: Research Report on technology, participants, trends, market size and share
Snowflake won the 2021 annual database
When synchronized encounters this thing, there is a big hole, pay attention!
22 API design practices