Ahora especifico la versión de Xcode en el archivo Fastlane como este:

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

Pero muestra este error:

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.

¿Qué debo hacer para especificar la versión de Xcode?

ios
1
Dolphin 22 ene. 2021 a las 05:22

1 respuesta

La mejor respuesta

Lo siguiente es suficiente:

xcversion(version: "12.3")

Según la Documentación:

Busca y selecciona una versión de un Xcode instalado (...)

Por tanto, la instrucción xcode-select no es necesaria. Con respecto a xcode_select, no estoy seguro de si existe.

1
LopesFigueiredo 1 feb. 2021 a las 08:11