簡體   English   中英

如何在 Fastlane 中指定 Xcode 版本?

[英]How to specify Xcode version in Fastlane?

現在我在 Fastlane 文件中指定 Xcode 版本,如下所示:

lane :beta do
    xcversion(version: "12.3")
    xcode_select "/Applications/Xcode_12.3.app"
    xcode-select -s /Applications/Xcode_12.3.app
    if is_ci
      create_keychain(
        name: ENV['MATCH_KEYCHAIN_NAME'],
        password: ENV["MATCH_KEYCHAIN_PASSWORD"],
        default_keychain: true,
        unlock: true,
        timeout: 3600,
        lock_when_sleeps: false
      )
    end
end

但它顯示了這個錯誤:

Run cd ./ios && bundle exec fastlane beta
+-----------------------+---------+--------+
|               Used plugins               |
+-----------------------+---------+--------+
| Plugin                | Version | Action |
+-----------------------+---------+--------+
| fastlane-plugin-pgyer | 0.2.2   | pgyer  |
+-----------------------+---------+--------+

[02:14:34]: Sending anonymous analytics information
[02:14:34]: Learn more at https://docs.fastlane.tools/#metrics
[02:14:34]: No personal or sensitive data is sent.
[02:14:34]: You can disable this by adding `opt_out_usage` at the top of your Fastfile
[02:14:34]:     12:   lane :beta do
[02:14:34]:     13:     xcversion(version: "12.3")
[02:14:34]:  => 14:     xcode-select -s /Applications/Xcode_12.3.app
[02:14:34]:     15:     if is_ci
[02:14:34]:     16:       create_keychain(

[!] Syntax error in your Fastfile on line 14: Fastfile:14: syntax error, unexpected unary-, expecting `do' or '{' or '('
    xcode-select -s /Applications/Xcode_12.3.app
                 ^
Fastfile:14: unknown regexp options - Xcd
...e-select -s /Applications/Xcode_12.3.app
...                         ^~~~~~
Fastfile:14: syntax error, unexpected local variable or method, expecting `end'
...elect -s /Applications/Xcode_12.3.app
...                            ^~~
Fastfile:14: unexpected fraction part after numeric literal
...ect -s /Applications/Xcode_12.3.app
...                             ^~
Fastfile:46: syntax error, unexpected `end', expecting end-of-input
Error: Process completed with exit code 1.

如何指定 Xcode 的版本?

以下內容就足夠了:

xcversion(version: "12.3")

根據文檔

查找並選擇已安裝 Xcode 的版本(...)

所以不需要xcode-select指令。 關於xcode_select ,不確定它是否存在。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM