用于在Fastlane的Appfile中存储环境变量的语法

问题描述 投票:4回答:2

我的Appfile当前看起来像这样:

apple_id "[email protected]"
app_identifier "com.xxx.xxx"
ENV["FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD"] = "xxxx-xxxx-xxxx-xxxx"
ENV["FASTLANE_PASSWORD"] = "myAppIdPassword"
ENV["DELIVER_USER"] = "[email protected]"
ENV["FASTLANE_USER"] = "[email protected]"
ENV["FASTLANE_TEAM_ID"] = "myTeamId"

而且我有这样的Fastfile

default_platform(:ios)

platform :ios do
  desc "Description of what the lane does"
  lane :qa do
    increment_build_number
    build_app(
        clean: true
    )
    verify_build(
       bundle_identifier: "com.xxx.xxx.project-name"
   )
   upload_to_testflight(skip_submission: true)
  end
end

发生的情况是,当我从控制台运行此程序时,fastlane无法从应用程序文件中读取,它询问我有关登录信息的信息。另外,我的Apple ID启用了两因素身份验证,并且我已经创建了应用专用密码,可以从Appfile中看到它,但仍然无法使用。看来Appfile没有被解析,或者我使用了错误的语法?我越来越像这样:

[15:22:51]: ----------------------------------
[15:22:51]: --- Step: upload_to_testflight ---
[15:22:51]: ----------------------------------
[15:22:51]: To not be asked about this value, you can specify it using 'username'
/Users/admin/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/highline-1.7.10/lib/highline.rb:624: warning: Using the last argument as keyword parameters is deprecated
[15:22:51]: Your Apple ID Username:

我不需要在终端提示中手动输入任何内容的方式是什么?

编辑:

也许这很重要...我的Apple ID启用了两个因素身份验证。但我认为它足以使用:FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD

ios swift xcode continuous-integration fastlane
2个回答
4
投票

我最近使用fastlane,这是我用过的东西

app_identifier("com.xxx.xxx") # The bundle identifier of your app
apple_id("[email protected]") # Your Apple email address

itc_team_id(“123456”) # App Store Connect Team ID
team_id(“1a2”d3f5g6g) # Developer Portal Team ID

1
投票

实际上起作用的是:

ENV["FASTLANE_USER"] = "[email protected]"
ENV["FASTLANE_PASSWORD"] = "xxxxxx"
ENV["FASTLANE_ITC_TEAM_ID"] = "123456789"
ENV["FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD"] = "xxx-xxx-xxx-xxxx"

问题出在ENV["FASTLANE_ITC_TEAM_ID"] =“ 123456789”行中

我没有引号,就像:

 ENV["FASTLANE_ITC_TEAM_ID"] = 123456789

显然文件没有被很好地解析,并且每次要求我提供Apple ID凭据-_-

© www.soinside.com 2019 - 2024. All rights reserved.