M1 Macs:
There is a known issue regarding some crypto related dependencies not running on Apple Silicon Machines. There is a workaround using Rosetta.
Navigate to your machine's Applications folder, right click Xcode, select Get Info. Select "Open with Rosetta". Quit and restart Xcode, and the project should run as in Intel based Mac would
If you don't have Rosetta installed, simply run:
softwareupdate --install-rosetta
in your terminal
Local set up:
- Run
pod install
to install the required dependencies. - Set the following environmental variables:
APPLE_ID_EMAIL: Your Apple ID email address.
FASTLANE_PASSWORD: Your Apple ID password for Fastlane.
Example:
export APPLE_ID_EMAIL="[email protected]"
export FASTLANE_PASSWORD="yourapplepassword"
Note: These variables are necessary for generating a signing certificate if you will create a new one. - Ensure you have the SSH private key for accessing the GitHub repository.
- Add the SSH private key to the SSH agent by running the following command:
ssh-add -K /path/to/private_key
This will grant you access to the HTTPS repository at https://github.com/AmplicaLabs/ios-fastlane-certs when pulling certificates. - Pull the signing certificate and profiles by running
fastlane make_ios_cert
You will be prompted to enter a passphrase to decrypt the certificate. Note: You will need to set a new passphrase each time you generate a new certificate. (Share it with the team). If you need to add a new UDID to the profiles, generate a new certificate usingfastlane match
- Open Xcode and configure manual signing by selecting the certificate pulled in the previous step. Note: fastlane match documentation can be found here: https://docs.fastlane.tools/actions/match/
Fastlane certificates:
- Delete old and Generate new certificate (Requires when a new device is added to the repo)
- Prepare the SSL phrase that will encrypt your profiles and certificates you can use https://bitwarden.com/password-generator/
- Add ssh key to the agent
ssh-add -K ~/.ssh/[your-private-key]
for GitHub access - Use the
fastlane match nuke development
feature - Manually delete the old provisioning profile in ~/Library/MobileDevice/Provisioning Profiles
- Manually delete old certificates from a keychain
- Run
fastlane match
again - It will generate a new certificated - Encrypt the certificate using password from step 1.