-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathfirebase-upload-symbols.sh
executable file
·140 lines (118 loc) · 4.53 KB
/
firebase-upload-symbols.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
#!/bin/sh
# firebase-upload-symbols.sh
# Created by Abdullah Alhaider on 18/4/20.
#
# TEMPLATE ONLY
# COMPLETE LINES 14, 17, 20 AND 23 BEFORE USING
#
# This script uploads dSYMs to Firebase for processing.
#
# Change path to dSYM folder
SAVED_dSYM_FOLDER="/Users/..../appDsyms"
# for example: 652ac70afbbde134719v4as01415fa9793da901f
SAVED_FABRIC_API_KEY="HERE_YOU_NEED_TO_ADD_FABRIC_API_KEY_IF_YOU_USE_FABRIC"
# Change path to Fabric upload script for your project
SAVED_UPLOAD_SCRIPT="/Users/..../Pods/Fabric/upload-symbols"
# Change path to Google services info for your project
SAVED_GOOGLE_CONFIG="/Users/.../GoogleService-Info.plist"
#######################################################################################
################################ Script ################################
#######################################################################################
ARCHIVE=$1
function fabric_with_saved_setting() {
log "============== Start Uploading... =============="
find "$SAVED_dSYM_FOLDER" -name "*.dSYM" | xargs -I \{\} $SAVED_UPLOAD_SCRIPT -a $SAVED_FABRIC_API_KEY -p ios \{\}
log "================ Upload complete ================"
};
function fabric_without_saved_setting() {
read -p "Enter your Fabric API key, must be equal to 40 character: " FABRIC_API_KEY
read -p "Enter full path for dSYM folder: " dSYMFOLDER
read -p "Enter full path for upload script: " UPLOADSCRIPT
log "============== Start Uploading... =============="
find "$dSYMFOLDER" -name "*.dSYM" | xargs -I \{\} $UPLOADSCRIPT -a $FABRIC_API_KEY -p ios \{\}
log "================ Upload complete ================"
};
function upload_to_fabric() {
if [ "$1" = "y" ];
then
fabric_with_saved_setting;
elif [ "$1" = "n" ];
then
fabric_without_saved_setting
else
log "Wrong input!, please re-run again"
exist 1
fi
}
function google_service_with_saved_setting() {
log "============== Start Uploading... =============="
find "$SAVED_dSYM_FOLDER" -name "*.dSYM" | xargs -I \{\} $SAVED_UPLOAD_SCRIPT -gsp $SAVED_GOOGLE_CONFIG -p ios \{\}
log "================ Upload complete ================"
};
function google_service_without_saved_setting() {
read -p "Enter your GoogleInfo.plit path: " GOOGLE_CONFIG
read -p "Enter full path for dSYM folder: " dSYMFOLDER
read -p "Enter full path for upload script: " UPLOADSCRIPT
log "============== Start Uploading... =============="
find "$dSYMFOLDER" -name "*.dSYM" | xargs -I \{\} $UPLOADSCRIPT -gsp $GOOGLE_CONFIG -p ios \{\}
log "================ Upload complete ================"
};
function upload_to_firebase() {
if [ "$1" = "y" ];
then
google_service_with_saved_setting;
elif [ "$1" = "n" ];
then
google_service_without_saved_setting
else
log "Wrong input!, please re-run again"
exist 1
fi
}
function log() {
echo "> $1"
}
welcome() {
echo "
###########################################################
###########################################################
=========== ==========
=========== firebase upload symbols tool ==========
=========== ==========
=========== by ==========
=========== ==========
=========== Abdullah Alhaider ==========
=========== ==========
=========== https://github.com/cs4alhaider ==========
=========== ==========
###########################################################
###########################################################
"
}
function run() {
welcome
# The "-d" of if checks if a directory exists
if [ -d $ARCHIVE ];
then
# log "${ARCHIVE}"
log "What method you would like to use?"
log "1️⃣ Fabric"
log "2️⃣ GoogleService-Info.plist"
log "================================================"
read -p "Enter your option [1/2]: " uploadmethod
read -p "Would you like to use pre-saved setting? [y/n]: " use_pre_saved_setting
if [ "$uploadmethod" = "1" ];
then
upload_to_fabric "$use_pre_saved_setting"
elif [ "$uploadmethod" = "2" ];
then
upload_to_firebase "$use_pre_saved_setting"
else
log "No option found for $uploadmethod"
exist 3
fi
else
log "Archive does not exist!"
fi
}
run