简体   繁体   中英

How to specify username in the command line for Fastlane?

I'm trying to pass in the apple ID to Fastlane as a command line option so all users and our build servers can use the same script.

MacBook-Pro-6:whisper-ios Nick$ fastlane hockeyglobal username:nlocking@whisper.sh
[18:00:44]: -------------------------------------------------
[18:00:44]: --- Step: Verifying required fastlane version ---
[18:00:44]: -------------------------------------------------
[18:00:44]: fastlane version valid
[18:00:44]: ------------------------------
[18:00:44]: --- Step: default_platform ---
[18:00:44]: ------------------------------
[18:00:44]: Driving the lane 'hockeyglobal' 🚀
[18:00:44]: ------------------
[18:00:44]: --- Step: sigh ---
[18:00:44]: ------------------

+-------------------------------------+-----------------------+
|                   Summary for sigh 1.8.0                    |
+-------------------------------------+-----------------------+
| adhoc                               | true                  |
| skip_install                        | false                 |
| development                         | false                 |
| force                               | false                 |
| app_identifier                      | sh.whisper.whisperapp |
| team_id                             | B3NYR7PARX            |
| ignore_profiles_with_different_name | false                 |
| skip_fetch_profiles                 | false                 |
| skip_certificate_verification       | false                 |
+-------------------------------------+-----------------------+

[18:00:45]: To not be asked about this value, you can specify it using 'username'
Your Apple ID Username: 

Maddeningly, username:nlocking@whisper.sh seems to go completely unnoticed by Fastlane, as does apple_id:nlocking@whisper.sh , -u nlocking@whisper.sh and everything else I've tried. What am I doing wrong?

尝试删除用户名,只添加app_identifierapple_id (电子邮件)和team_id在Appfile

It will use the value of apple_id in your fastlane/Appfile . Make sure you're running the command from the folder that fastlane/ is in.

Not sure about the hockeyglobal lane, but generally the correct syntax to pass the username parameter would be as follows:

fastlane hockeyglobal --username 'nlocking@whisper.sh'

Eg for default cert lane this works:

 fastlane cert --username 'me@myemailcom'

or

 fastlane cert -u 'me@myemailcom'

I achieved this by using fastlane parameters. In your Fastfile do something like this:

lane :beta do |options|
  cert(username: options[:username])
  ...
end

(notice the |options| parameter above)

Then invoke fastlane like this:

fastlane beta username:email@example.com

Where email@example.com is your username.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM