首页 > 解决方案 > Fastlane beta 构建工作,但快照无法构建

问题描述

我在自动构建、上传和批准 iOS 应用构建到 testflight 的“fastlane beta”通道上取得了很好的成功。

我正在尝试扩展使用范围以包括 fastlane 'snapshot' 以自动生成屏幕截图。我通过 fastlane 和 ray wenderlich 完成了设置教程(只是为了检查这不是我愚蠢!)...

它似乎一直在处理,直到它抱怨缺乏凭据

身份验证失败,因为未提供凭据。

但我不明白为什么这条路线会失败而“fastlane beta”工作得很好?关于我需要改变什么的任何想法?当“测试版”通道不需要时,这里可能需要什么凭据?
或者为什么在(相同的?!)构建期间一条路径有效而另一条路径失败?

终端消息:

[00:17:22]: Building and running project - this might take some time...

[00:17:23]: Patching simulators .../com.apple.iphonesimulator.plist' to scale to 100%

[00:17:24]: Using device named 'iPhone 11 Pro Max' with version '13.3' because no match was found for version '13.2'

[00:17:24]: Running snapshot on: iPhone 11 Pro Max

[00:17:24]: $ set -o pipefail && xcodebuild -workspace ./Power\ Zone\ Timer.xcworkspace -scheme Power\ Zone\ Timer -derivedDataPath '/var/folders/qs/cyr14d9n3zj11p5bcnr4vdh00000gn/T/snapshot_derived20200414-75065-4n5afc' -destination 'platform=iOS Simulator,name=iPhone 11 Pro Max,OS=13.3' FASTLANE_SNAPSHOT=YES build test | tee /Users/xxx/Library/Logs/snapshot/Challenges-Power\ Zone\ Timer.log | xcpretty 

[00:17:24]: ▸ Loading...

[00:17:30]: ▸ xcodebuild: error: Could not resolve package dependencies:

[00:17:30]: ▸   Authentication failed because no credentials were provided.
xcodebuild: error: Could not resolve package dependencies:
  Authentication failed because no credentials were provided.

[00:17:30]: Exit status: 74

标签: iosfastlane

解决方案


你有 Snapfile 设置吗?这是我使用的一个。

devices([ "iPhone 11"])
languages([ "en-US" ])
clean false
clear_previous_screenshots true
concurrent_simulators false
configuration "Debug"
erase_simulator false
launch_arguments([ "ADS_DISABLED" ])
localize_simulator true
namespace_log_files true
output_directory "./fastlane/screenshots/"
output_simulator_logs true
reinstall_app false
result_bundle false
scheme "MyApp Free"
skip_open_summary true
stop_after_first_error true
workspace "./MyApp.xcworkspace"

推荐阅读