【发布时间】:2019-07-15 00:22:36
【问题描述】:
我正在使用 fastlane,以 https://docs.fastlane.tools/getting-started/ios/setup/ docs 的身份进行操作。 但无法正确设置。
请指导我。
【问题讨论】:
-
请说明您具体尝试了什么,遇到了什么错误,在哪里。
标签: android ios automation fastlane
我正在使用 fastlane,以 https://docs.fastlane.tools/getting-started/ios/setup/ docs 的身份进行操作。 但无法正确设置。
请指导我。
【问题讨论】:
标签: android ios automation fastlane
在研发上花费了足够的时间后,我找到了安装快车道的正确方法。
我在这里发布一些命令。把它一个一个粘贴到你的终端上
1: curl -L https://get.rvm.io | bash -s stable --auto-dotfiles --autolibs=enable --rails
2:GPG 安装 -> ruby -e “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)”
3:brew install gnupg
4:RVM 安装 -> gpg --keyserver hkp://ipv4.pool.sks-keyservers.net --recv-keys 409B6B1796C275462A1703113XXXXXXXXXXX 7D2BAF1CF37B13E2069XXXXXXXXXXXXXX
5:来源/Users/bedi/.rvm/scripts/rvm
6: curl -sSL https://get.rvm.io | bash -s stable --ruby
7:gem 安装 fastlane
8: brew list openssl@1.1
9: ln -s /usr/local/Cellar/openssl@1.1/1.1.0f/bin/openssl /usr/local/bin/openssl
就是这样,您现在已经为 fastlane 设置了完整的先决条件。 现在您可以根据您的目标操作系统进行设置了。
1) https://docs.fastlane.tools/getting-started/ios/setup/
2) https://docs.fastlane.tools/getting-started/android/setup/
【讨论】:
Fastlane 是一组工具,可用于自动构建和发布您的 iOS 和 Android 应用。如果您之前尝试过将应用程序交付到 TestFlight 或 Apple Store,那么您知道该过程需要多长时间:归档应用程序,将其导出到 AppleStore,添加新版本(在无限处理时间之后),为每台设备添加屏幕截图,再跳几圈,最后yy,让您的测试人员或全世界都可以使用它。首先,我们将安装和设置fastlane。假设您使用的是 Mac,请打开终端并运行以下每个命令:
安装 Fastlane 后,您可以根据需要添加不同的工具。这里是 list of fastlane commands from github:
创建 xcode 项目后,转到其文件夹并运行 fastlane init 。该脚本将提示您输入您的 Apple ID/密码、应用程序标识符、方案,如有必要,在 iTunes Connect 和 Apple Developer Port 上创建应用程序,并将所有这些信息存储在 fastlane/Appfile 和 fastlane/Deliverfile 中。 Once everything is correctly set up, you should see something like that: Fastlane 然后将在 Fastfile 中创建一个名为 fastlane 的文件夹,该文件夹是 ruby 配置脚本。这是一个示例文件:
# Customise this file, documentation can be found here:
fastlane actions 命令列出fastlane 时,所有以# 开头的行都会被忽略
fastlane_version "1.89.0"
default_platform :ios
平台 :ios 做 before_all 做 #test # 设置正确的 url,向下滚动到第 3 部分 ENV["SLACK_URL"] ||= "https://hooks.slack.com/services/xxxxxxx"
# URL for Project #ios channel
#ENV["SLACK_URL"] ||= "https://hooks.slack.com/services/xxxx"
slack(message:"New version recieved, processing started")
end
after_all do |lane|
# This block is called, only if the executed lane was successful
# slack(
# message: "New App Update successfully deployed."
# )
end
error do |lane, exception|
slack(
message: exception.message,
success: false
)
end
#lane to run unit tests
desc "[TEST] Runs all the tests"
lane :unittest do
scan
end
#lane to send app to testflight
desc "[TESTFLIGHT] publish production"
lane :tf_production do
apple_testflight(scheme: "YOUR_SCHEME_NAME")
end
desc "[STORE] Deploy a new version"
lane :app_store do
# match(type: "appstore")
# snapshot
build(scheme:"YOUR_SCHEME_NAME")
deliver(force: true)
# frameit
end
desc "[PRIVATE] Deploy a new version to the Testflight"
private_lane :apple_testflight do |options|
scheme = options[:scheme]
slack(message: "Starting processing "+scheme+" for Testflight")
cert
sigh
#TODO: fix "increment_build_number" to bump ONLY the build number or the selected scheme
# increment_build_number
build(scheme: scheme)
resign(signing_identity:'#Name of the certificate as shown in the Keychain, for ex: iPhone Distribution: My COMPANY (XXXXXXXX)')
pilot(
)
slack(message: "Processing finished")
end
desc "[PRIVATE] Build usign schema"
private_lane :build do |options|
scheme = options[:scheme]
cocoapods
gym(
scheme: scheme,
codesigning_identity: '#Name of the certificate as shown in the Keychain, for ex: iPhone Distribution: My COMPANY (XXXXXXXX)'
)
end
结束
【讨论】: