当前位置:网站首页>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
边栏推荐
- When synchronized encounters this thing, there is a big hole, pay attention!
- Possible to restore a backup of SQL Server 2014 on SQL Server 2012?
- MySQL performance optimization index
- Cadence physical library lef file syntax learning [continuous update]
- R语言--readr包读写数据
- [Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 17
- [Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 12
- 0x15 string
- Map container
- Force buckle 142 Circular linked list II
猜你喜欢
What if the chat record is gone? How to restore wechat chat records on Apple Mobile
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 15
Entitas learning [iv] other common knowledge points
【数据聚类】第四章第一节3:DBSCAN性能分析、优缺点和参数选择方法
[solve the error of this pointing in the applet] SetData of undefined
vim 出现 Another program may be editing the same file. If this is the case 的解决方法
CSDN documentation specification
The database connection code determines whether the account password is correct, but the correct account password always jumps to the failure page with wrong account password
昨天的事情想说一下
C语言数组
随机推荐
Haproxy cluster
queue
Communication tutorial | overview of the first, second and third generation can bus
Data communication and network: ch13 Ethernet
13、 C window form technology and basic controls (3)
First knowledge of spark - 7000 words +15 diagrams, and learn the basic knowledge of spark
LVS load balancing cluster deployment - Dr direct routing mode
16.内存使用与分段
How to use the mongodb ID array to get multiple documents- How to get multiple document using array of MongoDb id?
Entity framework calls Max on null on records - Entity Framework calling Max on null on records
Global and Chinese markets for environmental disinfection robots 2022-2028: Research Report on technology, participants, trends, market size and share
Entitas learning [iv] other common knowledge points
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 8
C语言:围圈报号排序问题
TCP fast retransmission sack mechanism
Uva536 binary tree reconstruction tree recovery
C语言:求字符串的长度
C语言数组
OSI seven layer model & unit
Workplace liquor bureau must pay attention to