当前位置:网站首页>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
边栏推荐
- JD home programmers delete databases and run away. Talk about binlog, the killer of MySQL data backup
- 'using an alias column in the where clause in PostgreSQL' - using an alias column in the where clause in PostgreSQL
- [Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 12
- VBA, JSON interpretation, table structure -json string conversion
- First knowledge of spark - 7000 words +15 diagrams, and learn the basic knowledge of spark
- The solution of permission denied
- Iterm tab switching order
- C language memory layout
- Global and Chinese markets of NOx analyzers 2022-2028: Research Report on technology, participants, trends, market size and share
- OSI seven layer model & unit
猜你喜欢
CSDN documentation specification
Leetcode day 17
When synchronized encounters this thing, there is a big hole, pay attention!
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 14
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 19
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 10
Reptile learning 3 (winter vacation learning)
Bottom Logic -- Mind Map
Data communication and network: ch13 Ethernet
Enter the smart Park, and change begins here
随机推荐
Realize cross tenant Vnet connection through azure virtual Wan
Alibaba cloud server connection intranet operation
JD home programmers delete databases and run away. Talk about binlog, the killer of MySQL data backup
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 16
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
VBA, JSON interpretation, table structure -json string conversion
C语言:围圈报号排序问题
Reptile learning 3 (winter vacation learning)
01. Basics - MySQL overview
Global and Chinese market for naval vessel maintenance 2022-2028: Research Report on technology, participants, trends, market size and share
How do std:: function and function pointer assign values to each other
Complementary knowledge of auto encoder
Btrace tells you how to debug online without restarting the JVM
SAP ui5 date type sap ui. model. type. Analysis of the display format of date
[the way of programmer training] - 2 Perfect number calculation
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 24
[Android reverse] function interception instance (③ refresh CPU cache | ④ process interception function | ⑤ return specific results)
Azure solution: how can third-party tools call azure blob storage to store data?
Bottom Logic -- Mind Map
Communication tutorial | overview of the first, second and third generation can bus