Last active
February 17, 2018 06:54
-
-
Save eni9889/003ea03206b01cdd45b9c00ca7c6e301 to your computer and use it in GitHub Desktop.
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 characters
#!/bin/bash | |
# Use -gt 1 to consume two arguments per pass in the loop (e.g. each | |
# argument has a corresponding value to go with it). | |
# Use -gt 0 to consume one or more arguments per pass in the loop (e.g. | |
# some arguments don't have a corresponding value to go with it such | |
# as in the --default example). | |
# note: if this is set to -gt 0 the /etc/hosts part is not recognized ( may be a bug ) | |
while [[ $# -gt 1 ]] | |
do | |
key="$1" | |
case $key in | |
-p|--profile) | |
PROVISIONING_PROFILE="$2" | |
shift # past argument | |
;; | |
-b|--prefix) | |
BUNDLE_ID_PREFIX="$2" | |
shift # past argument | |
;; | |
-n|--overridename) | |
OVERRIDE_NAME="$2" | |
shift # past argument | |
;; | |
-k|--identity) | |
IDENTITY="$2" | |
shift # past argument | |
;; | |
-i|--input) | |
INPUT_FOLDER_PATH="$2" | |
shift # past argument | |
;; | |
-o|--output) | |
OUTPUT_FOLDER_PATH="$2" | |
shift # past argument | |
;; | |
-l|--dylib) | |
DYLIB_PATH="$2" | |
shift # past argument | |
;; | |
--default) | |
DEFAULT=YES | |
;; | |
*) | |
# unknown option | |
;; | |
esac | |
shift # past argument or value | |
done | |
echo INPUT_FOLDER_PATH = "${INPUT_FOLDER_PATH}" | |
echo OUTPUT_FOLDER_PATH = "${OUTPUT_FOLDER_PATH}" | |
echo PROVISIONING_PROFILE = "${PROVISIONING_PROFILE}" | |
echo IDENTITY = "${IDENTITY}" | |
echo BUNDLE_ID_PREFIX = "${BUNDLE_ID_PREFIX}" | |
echo OVERRIDE_NAME = "${OVERRIDE_NAME}" | |
mkdir -p $OUTPUT_FOLDER_PATH | |
cd "$INPUT_FOLDER_PATH" | |
for IPA_NAME in *.ipa | |
do | |
if [ -e "$INPUT_FOLDER_PATH/$IPA_NAME" ] | |
then | |
echo "PROCESSING $IPA_NAME" | |
EXTENSION="${IPA_NAME##*.}" | |
FILENAME="${IPA_NAME%.*}" | |
echo "FILENAME: $FILENAME" | |
echo "EXTENSION: $EXTENSION" | |
if [ ! -z "$BUNDLE_ID_PREFIX" ] | |
then | |
BUNDLE_ID="$BUNDLE_ID_PREFIX.$FILENAME" | |
echo "USING BUNDLE ID: $BUNDLE_ID" | |
fi | |
if [ ! -z "$OVERRIDE_NAME" ] | |
then | |
DISPLAY_NAME="$FILENAME" | |
echo "USING DISPLAY NAME: $DISPLAY_NAME" | |
fi | |
if [ ! -z "$IPA_NAME" ] | |
then | |
~/Documents/sign_ipa -p "${PROVISIONING_PROFILE}" -k "${IDENTITY}" -i "$INPUT_FOLDER_PATH/$IPA_NAME" -o "$OUTPUT_FOLDER_PATH/$IPA_NAME" -l "$DYLIB_PATH" -b "$BUNDLE_ID" -n "$DISPLAY_NAME" | |
fi | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
First follow instructions for: https://gist.github.com/eni9889/eed5d58acfd6abe9bfe4c91f6f360df2
Save this file to
~/Documents/sign_all_ipas
Then in terminal run
chmod +x ~/Documents/sign_all_ipas
Then the command should looks something like the below commands.
If you want to change the bundle and override the display name:
If you just want to change bundle:
Or just name:
Or none:
This is assuming you saved this file in
~/Documents/