当前位置:网站首页>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
边栏推荐
- Clockwise rotation method of event arrangement -- PHP implementation
- How to disable debug messages on sockjs stomp - how to disable debug messages on sockjs Stomp
- C语言:围圈报号排序问题
- [notes] streamingassets
- Experiment 7. IPv6
- TCP fast retransmission sack mechanism
- How to use the mongodb ID array to get multiple documents- How to get multiple document using array of MongoDb id?
- Paper notes ACL 2020 improving event detection via open domain trigger knowledge
- DC-5靶机
- [Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 13
猜你喜欢
![[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 6](/img/38/51797fcdb57159b48d0e0a72eeb580.jpg)
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 6

Here, the DDS tutorial you want | first experience of fastdds - source code compilation & Installation & Testing

Reptile learning 4 winter vacation series (3)
![[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 14](/img/c5/dde92f887e8e73d7db869fcddc107f.jpg)
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 14

记一次 Showing Recent Errors Only Command /bin/sh failed with exit code 1 问题

How to realize the function of Sub Ledger of applet?

nn. Exploration and experiment of batchnorm2d principle

Memory computing integration: AI chip architecture in the post Moorish Era

DC-5靶机

The detailed installation process of Ninja security penetration system (Ninjitsu OS V3). Both old and new VM versions can be installed through personal testing, with download sources
随机推荐
Lecture 9
Article download address
Ternsort model integration summary
Translation D29 (with AC code POJ 27:mode of sequence)
Exness: positive I win, negative you lose
[notes] in depth explanation of assets, resources and assetbundles
Talk about "in C language"
nn. Exploration and experiment of batchnorm2d principle
How to use the mongodb ID array to get multiple documents- How to get multiple document using array of MongoDb id?
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 16
Experiment 7. IPv6
. Does net 4 have a built-in JSON serializer / deserializer- Does . NET 4 have a built-in JSON serializer/deserializer?
How to realize the function of Sub Ledger of applet?
DC-5靶机
MPLS experiment
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 8
Anti clockwise rotation method of event arrangement -- PHP implementation
Memory computing integration: AI chip architecture in the post Moorish Era
[notes] streamingassets
17.内存分区与分页