See Fastlane doc and this doc:
https://firebase.google.com/docs/app-distribution/ios/distribute-fastlane
https://firebase.google.com/docs/cli
On Mac:
brew install firebase-cliOr using npm:
npm install -g firebase-toolsOr using autoinstall script:
curl -sL https://firebase.tools | bashOr from DevOps-Bash-tools:
install_firebase_cli.shOr download and chmod +x it manually from:
https://firebase.tools/bin/macos/latest
https://firebase.tools/bin/linux/latest
(these redirect to the latest release from https://github.com/firebase/firebase-tools/releases/)
Interactive web browser redirect to log in as your user.
firebase loginfirebase login:listLogged in as hari@domain.com
You can generate this at the top left Project Settings -> Service Accounts -> Generate new private key for the
firebase-adminsdk-xxxxx@$PROJECT_ID.iam.gserviceaccount.com.
If you don't want to use the default adminsdk key, create a new service account by clicking
Manage service account permissions at the top right of the above Service Accounts page,
then create a new service account and grant it only Firebase App Distribution Admin.
Then on the service account page -> Keys -> Add key and download it.
export GOOGLE_APPLICATION_CREDENTIALS="path/to/your-file.json"firebase login:list will still show:
⚠ No authorized accounts, run "firebase login"
but commands will work. List projects to prove it.
firebase projects:listfirebase projects:list --jsonUnfortunately projects:list returns zero even when outputting No projects found. imply the credential is invalid or
doesn't have the right permissions.
To test this properly in scripts or CI/CD:
num_projects="$(firebase projects:list --json | jq '.result | length')"
if [ "$num_projects" -eq 0 ]; then
exit 1
fiSee also from DevOps-Bash-tools:
firebase_foreach_project.shSpecifying --project for every firebase command is tedious.
--project "<project_id>"
See the Project ID column from firebase projects:list.
Instead, create .firebaserc:
{
"projects": {
"default": "myproject-dev-id",
"dev": "myproject-dev-id",
"staging": "myproject-staging-id",
"prod": "myproject-production-id",
}
}You can also use these shorter names:
--project "dev"
instead of
--project "myprofile-dev-id"
To get the Firebase App ID that you need to push artifact releases to:
firebase apps:list --project "myproject"or if you've set up the project config defaults above:
firebase apps:listfirebase apps:list --jsonTester emails are comma separated.
firebase appdistribution:distribute \
--testers "$TESTER_EMAILS" \
--app "$FIREBASE_APP_ID" \
build/"$APP-$ENV".ipa