Created
July 11, 2023 08:25
-
-
Save yonat/56495c07d3c76a320d9be0721682daf3 to your computer and use it in GitHub Desktop.
Revisions
-
yonat created this gist
Jul 11, 2023 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,21 @@ # 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 }