【发布时间】:2019-12-09 08:26:45
【问题描述】:
我正在尝试在 CircleCI 中运行预定的工作流程,该工作流程将从 iTunes/AppStore Connect 下载我的应用的 DSyms 并将它们上传到 Firebase 的 Crashlytics,但 fastlane 要求我输入 Apple 的密码 - 并且构建停止:
[⠋] ???? [⠙] ???? [⠹] ???? [⠸] ???? [⠼] ???? [⠴] ???? [⠦] ???? [⠧] ???? [⠇] ???? [✔] ????
[14:32:26]: Sending anonymous analytics information
[14:32:26]: Learn more at https://docs.fastlane.tools/#metrics
[14:32:26]: No personal or sensitive data is sent.
[14:32:26]: You can disable this by adding `opt_out_usage` at the top of your Fastfile
[14:32:26]: ------------------------------
[14:32:26]: --- Step: default_platform ---
[14:32:26]: ------------------------------
[14:32:26]: Driving the lane 'ios dsyms' ????
[14:32:26]: -----------------------------
[14:32:26]: --- Step: setup_circle_ci ---
[14:32:26]: -----------------------------
[14:32:26]: Creating temporary keychain: "fastlane_tmp_keychain".
[14:32:26]: Enabling match readonly mode.
[14:32:26]: -----------------------------------
[14:32:26]: --- Step: clean_build_artifacts ---
[14:32:26]: -----------------------------------
[14:32:26]: Cleaned up build artifacts ????
[14:32:26]: ----------------------------
[14:32:26]: --- Step: download_dsyms ---
[14:32:26]: ----------------------------
[14:32:26]: Login to App Store Connect (MY_APPLE_ID)
-------------------------------------------------------------------------------------
Please provide your Apple Developer Program account credentials
The login information you enter will be stored in your macOS Keychain
You can also pass the password using the `FASTLANE_PASSWORD` environment variable
See more information about it on GitHub: https://github.com/fastlane/fastlane/tree/master/credentials_manager
-------------------------------------------------------------------------------------
Password (for MY_APPLE_ID): **
我正在定义 FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD、FASTLANE_USER、MATCH_PASSWORD 和 PILOT_APPLE_ID 环境变量。
这足以运行upload_to_testflight(skip_waiting_for_build_processing: true),但不能使download_dsyms 工作。
我的.circleci/config.yml(复制如下)基本上只运行fastlane dsyms,这样定义的车道:
desc "Upload latest debug symbols to Crashlytics"
lane :dsyms do
clean_build_artifacts
download_dsyms(version: 'latest')
upload_symbols_to_crashlytics
clean_build_artifacts
end
我的.circleci/config.yml:
version: 2
jobs:
dsyms:
macos:
xcode: "10.2.1"
working_directory: /Users/distiller/project
environment:
FL_OUTPUT_DIR: output
FASTLANE_LANE: dsyms
shell: /bin/bash --login -o pipefail
steps:
- checkout
- restore_cache:
key: 1-gems-{{ checksum "Gemfile.lock" }}
- run: bundle check || bundle install --path vendor/bundle
- save_cache:
key: 1-gems-{{ checksum "Gemfile.lock" }}
paths:
- vendor/bundle
- run:
name: fastlane
command: bundle exec fastlane $FASTLANE_LANE
- store_artifacts:
path: output
workflows:
version: 2
scheduled-workflow:
triggers:
- schedule:
cron: "* 0 * * *"
filters:
branches:
only:
- testflight
jobs:
- dsyms
我的(修整过的其他车道)fastlane/Fastfile:
default_platform(:ios)
platform :ios do
before_all do
setup_circle_ci
end
desc "Upload latest debug symbols to Crashlytics"
lane :dsyms do
clean_build_artifacts
download_dsyms(version: 'latest')
upload_symbols_to_crashlytics
clean_build_artifacts
end
end
如何让 CI 从 Apple 下载 DSyms?
编辑:如果我将密码添加为FASTLANE_PASSWORD 环境变量,那么构建仍然无法请求 2FA 令牌。
[07:04:08]: Sending anonymous analytics information
[07:04:08]: Learn more at https://docs.fastlane.tools/#metrics
[07:04:08]: No personal or sensitive data is sent.
[07:04:08]: You can disable this by adding `opt_out_usage` at the top of your Fastfile
[07:04:08]: ------------------------------
[07:04:08]: --- Step: default_platform ---
[07:04:08]: ------------------------------
[07:04:08]: Driving the lane 'ios dsyms' ????
[07:04:08]: -----------------------------
[07:04:08]: --- Step: setup_circle_ci ---
[07:04:08]: -----------------------------
[07:04:08]: Creating temporary keychain: "fastlane_tmp_keychain".
[07:04:08]: Enabling match readonly mode.
[07:04:08]: -----------------------------------
[07:04:08]: --- Step: clean_build_artifacts ---
[07:04:08]: -----------------------------------
[07:04:08]: Cleaned up build artifacts ????
[07:04:08]: ----------------------------
[07:04:08]: --- Step: download_dsyms ---
[07:04:08]: ----------------------------
[07:04:08]: Login to App Store Connect (xxxxxxxx@example.com)
Two-factor Authentication (6 digits code) is enabled for account 'xxxxxxxx@example.com'
More information about Two-factor Authentication: https://support.apple.com/en-us/HT204915
If you're running this in a non-interactive session (e.g. server or CI)
check out https://github.com/fastlane/fastlane/tree/master/spaceship#2-step-verification
(Input `sms` to escape this prompt and select a trusted phone number to send the code as a text message)
(You can also set the environment variable `SPACESHIP_2FA_SMS_DEFAULT_PHONE_NUMBER` to automate this)
(Read more at: https://github.com/fastlane/fastlane/blob/master/spaceship/docs/Authentication.md#auto-select-sms-via-spaceship-2fa-sms-default-phone-number)
Please enter the 6 digit code:
+---------------------------+--------------------------------------------------------+
| Lane Context |
+---------------------------+--------------------------------------------------------+
| DEFAULT_PLATFORM | ios |
| PLATFORM_NAME | ios |
| LANE_NAME | ios dsyms |
| ORIGINAL_DEFAULT_KEYCHAIN | "/Users/distiller/Library/Keychains/login.keychain-db" |
+---------------------------+--------------------------------------------------------+
+------+-----------------------+-------------+
| fastlane summary |
+------+-----------------------+-------------+
| Step | Action | Time (in s) |
+------+-----------------------+-------------+
| 1 | default_platform | 0 |
| 2 | setup_circle_ci | 0 |
| 3 | clean_build_artifacts | 0 |
| ???? | download_dsyms | 0 |
+------+-----------------------+-------------+
[07:04:09]: fastlane finished with errors
【问题讨论】:
标签: continuous-integration fastlane app-store-connect