forked from hrydgard/ppsspp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcopysym.sh
More file actions
executable file
·60 lines (40 loc) · 1.52 KB
/
copysym.sh
File metadata and controls
executable file
·60 lines (40 loc) · 1.52 KB
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
#!/bin/bash
set -euo pipefail
# === CONFIGURATION ===
APP_NAME="PPSSPP" # Name of your app bundle (no .app extension)
DSYM_PATH="build-ios/Release-iphoneos/${APP_NAME}.app.dSYM"
# === Find latest .xcarchive ===
ARCHIVE_DIR_BASE=~/Library/Developer/Xcode/Archives
LATEST_ARCHIVE=$(find "$ARCHIVE_DIR_BASE" -type d -name "*.xcarchive" -print0 | xargs -0 ls -td | head -n 1)
if [ ! -d "$LATEST_ARCHIVE" ]; then
echo "❌ Could not find .xcarchive in $ARCHIVE_DIR_BASE"
exit 1
fi
echo "📦 Found archive: $LATEST_ARCHIVE"
# === Extract binary UUID from .app inside archive ===
ARCHIVE_APP="$LATEST_ARCHIVE/Products/Applications/${APP_NAME}.app/${APP_NAME}"
if [ ! -f "$ARCHIVE_APP" ]; then
echo "❌ App binary not found in archive: $ARCHIVE_APP"
exit 1
fi
ARCHIVE_UUIDS=$(dwarfdump --uuid "$ARCHIVE_APP" | awk '{ print $2 }' | sort)
# === Extract UUID from your .dSYM ===
DSYM_BINARY="$DSYM_PATH/Contents/Resources/DWARF/${APP_NAME}"
if [ ! -f "$DSYM_BINARY" ]; then
echo "❌ .dSYM binary not found: $DSYM_BINARY"
exit 1
fi
DSYM_UUIDS=$(dwarfdump --uuid "$DSYM_BINARY" | awk '{ print $2 }' | sort)
# === Compare UUIDs ===
if [ "$ARCHIVE_UUIDS" != "$DSYM_UUIDS" ]; then
echo "❌ UUID mismatch:"
echo "Archive binary UUIDs: $ARCHIVE_UUIDS"
echo "Your dSYM UUIDs: $DSYM_UUIDS"
exit 1
fi
echo "✅ UUIDs match!"
# === Copy dSYM into archive ===
DEST="$LATEST_ARCHIVE/dSYMs/$(basename "$DSYM_PATH")"
echo "📁 Copying dSYM to archive: $DEST"
cp -R "$DSYM_PATH" "$DEST"
echo "✅ dSYM successfully copied to archive."