代码之家  ›  专栏  ›  技术社区  ›  Whirlwind

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

  •  0
  • Whirlwind  · 技术社区  · 5 年前

    我的 Appfile 目前看起来是这样的:

    apple_id "myappid@domain.com"
    app_identifier "com.xxx.xxx"
    ENV["FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD"] = "xxxx-xxxx-xxxx-xxxx"
    ENV["FASTLANE_PASSWORD"] = "myAppIdPassword"
    ENV["DELIVER_USER"] = "myappid@domain.com"
    ENV["FASTLANE_USER"] = "myappid@domain.com"
    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不会从应用程序文件中读取,它会询问我登录信息。此外,我的苹果id启用了双因素身份验证,我创建了特定于应用程序的密码,可以从Appfile中看到,但它仍然不起作用。看起来Appfile没有解析,或者我使用了错误的语法?我得到的smth是这样的:

    [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:
    

    有什么方法可以让我不必在终端提示中手动输入任何内容?

    编辑:

    也许这很重要。。。我的苹果id上启用了双因素身份验证。但我认为使用它就足够了: FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD

    0 回复  |  直到 5 年前
        1
  •  6
  •   Whirlwind    5 年前

    实际上奏效的是:

    ENV["FASTLANE_USER"] = "myappleid@domain.com"
    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
    

    很明显,文件解析得不好,每次我都被要求提供我的苹果id凭据-_-

        2
  •  6
  •   umer farooqi    5 年前

    我最近在快车道工作,这是我使用的

    app_identifier("com.xxx.xxx") # The bundle identifier of your app
    apple_id("myappid@domain.com") # Your Apple email address
    
    itc_team_id(“123456”) # App Store Connect Team ID
    team_id(“1a2”d3f5g6g) # Developer Portal Team ID