Last active
March 8, 2020 07:52
-
-
Save fromkk/1d64ee9c0610b3f2ec4db69f07523a4b to your computer and use it in GitHub Desktop.
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
#!/bin/sh | |
function help() { | |
cat <<EOF | |
$(basename ${0}) is a tool for upload dsyms for Firebase Crashlytics | |
Usage: | |
$(basename ${0}) [dsyms.zip path] [Google-Service.plist path] | |
$(basename ${0}) [dsyms.zip path] [fabric API Key] | |
e.g. | |
$(basename ${0}) "/path/to/dsyms.zip" "/Path/To/GoogleService_info.plist" | |
EOF | |
} | |
if [ $# -ne 2 ]; then | |
help | |
exit 1 | |
fi | |
DSYMS_PATH=$1 | |
PLIST_PATH=$2 | |
function perform_upload() { | |
DSYM_PATH=$1 | |
if [ ! -f $PLIST_PATH ]; then | |
"Pods/Fabric/upload-symbols" -a "${PLIST_PATH}" -p ios "${tmp_dir}/${DSYM_PATH}" | |
else | |
"Pods/Fabric/upload-symbols" -gsp "${PLIST_PATH}" -p ios "${tmp_dir}/${DSYM_PATH}" | |
fi | |
} | |
if [ ! -f $DSYMS_PATH -a ! -d $DSYMS_PATH ]; then | |
echo "dsyms not found ${DSYMS_PATH}" 1>&2 | |
exit 1 | |
fi | |
DSYM_EXTENSION=${DSYMS_PATH##*.} | |
if [ $DSYM_EXTENSION = "zip" ]; then | |
tmp_dir=`mktemp -d` | |
unzip $DSYMS_PATH -d $tmp_dir | |
files=$(ls $tmp_dir) | |
for file in $files; do | |
perform_upload $file | |
done | |
rm -rf "$tmp_dir" | |
elif [ $DSYM_EXTENSION = "dSYM" ]; then | |
perform_upload $DSYMS_PATH | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment