当前位置:网站首页>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
边栏推荐
- How to disable debug messages on sockjs stomp - how to disable debug messages on sockjs Stomp
- Abnormal mode of ARM processor
- Unity performance optimization reading notes - explore performance issues -profiler (2.1)
- Global and Chinese market for naval vessel maintenance 2022-2028: Research Report on technology, participants, trends, market size and share
- Uva536 binary tree reconstruction tree recovery
- Leetcode day 17
- Classification and application of AI chips
- SAP ui5 date type sap ui. model. type. Analysis of the display format of date
- Data communication and network: ch13 Ethernet
- Global and Chinese market of piston rod 2022-2028: Research Report on technology, participants, trends, market size and share
猜你喜欢
Ternsort model integration summary
Complementary knowledge of auto encoder
It's hard to hear C language? Why don't you take a look at this (V) pointer
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 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
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 17
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 19
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 7
Data communication and network: ch13 Ethernet
Review of week 278 of leetcode II
随机推荐
Unity performance optimization reading notes - explore performance issues -profiler (2.1)
How do std:: function and function pointer assign values to each other
queue
A few words explain redis cache penetration, breakdown, avalanche, and redis sentinel
MYCAT middleware installation and use
Global and Chinese market of ice water machines 2022-2028: Research Report on technology, participants, trends, market size and share
Error: Failed to download metadata for repo ‘AppStream‘: Cannot download repomd. XML solution
Alibaba cloud server connection intranet operation
C语言:求字符串的长度
The most robust financial products in 2022
Leetcode day 17
Translation D29 (with AC code POJ 27:mode of sequence)
8.8.1-PointersOnC-20220214
MPLS experiment
[Android reverse] function interception instance (③ refresh CPU cache | ④ process interception function | ⑤ return specific results)
Netgear switch basic configuration command set
OSI seven layer model & unit
. Does net 4 have a built-in JSON serializer / deserializer- Does . NET 4 have a built-in JSON serializer/deserializer?
22 API design practices
It's hard to hear C language? Why don't you take a look at this (V) pointer