Created
July 11, 2023 08:25
-
-
Save yonat/56495c07d3c76a320d9be0721682daf3 to your computer and use it in GitHub Desktop.
Generate push certificate using fast lane, and create additional p12 for use in the Keychain Access app
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Generate push certificates. | |
# Usage: generate_push_certificate <app-bundle-id> <user-email> <cert-password> | |
generate_push_certificate() { | |
app=$1 | |
user=$2 | |
password=$3 | |
fastlane pem -a "$app" -u "$user" -p "$password" | |
convert_push_certificate_to_keychain_format "production_${app}_ios.p12" "$password" | |
} | |
# Convert p12 to Keychain acceptable format. | |
# Usage: convert_push_certificate_to_keychain_format <cert-file.p12> <cert-password> | |
convert_push_certificate_to_keychain_format() { | |
cert=$1 | |
password=$2 | |
/opt/homebrew/opt/openssl@1.1/bin/openssl pkcs12 -in "$cert" -out temp.pem -passin pass:"$password" -passout pass:"$password" | |
/opt/homebrew/opt/openssl@1.1/bin/openssl pkcs12 -export -in temp.pem -out "keychain_$cert" -passin pass:"$password" -passout pass:"$password" | |
rm temp.pem | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment