Repository navigation
Expand file tree
/
Copy pathdebug.sh
More file actions
executable file
·65 lines (55 loc) · 1.9 KB
/
Copy pathdebug.sh
File metadata and controls
executable file
·65 lines (55 loc) · 1.9 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
61
62
63
64
65
#!/bin/bash
# Collects diagnostics that can be pasted straight into an issue.
#
# ./debug.sh print environment + bundle info + recent logs
# ./debug.sh --run additionally run the binary in the foreground; crash
# output lands directly in the terminal
set -uo pipefail
cd "$(dirname "$0")"
APP="iCleaner.app"
SUBSYSTEM="local.icleaner.app"
RUN=0
[ "${1:-}" = "--run" ] && RUN=1
line() { printf '\n===== %s =====\n' "$1"; }
line "Environment"
sw_vers 2>/dev/null
uname -m
swift --version 2>&1 | head -2
xcode-select -p 2>/dev/null
line "App bundle"
if [ ! -d "$APP" ]; then
echo "$APP does not exist — run ./build.sh first"
exit 1
fi
find "$APP" -maxdepth 3 -not -path '*/_CodeSignature/*' | sort
echo
/usr/libexec/PlistBuddy -c Print "$APP/Contents/Info.plist" 2>/dev/null
line "Signing"
codesign -dv --verbose=2 "$APP" 2>&1 | head -20
echo "--- Verify ---"
codesign --verify --deep --strict "$APP" 2>&1 | head -10 || true
line "Quarantine attribute (Gatekeeper)"
xattr -l "$APP" 2>/dev/null || echo "(none)"
line "Localization resources"
for f in "$APP"/Contents/Resources/*.lproj/Localizable.strings; do
[ -f "$f" ] || continue
printf '%s: ' "$f"
plutil -lint "$f" 2>&1 | tail -1
done
line "Recent crash reports"
ls -t ~/Library/Logs/DiagnosticReports/iCleaner* 2>/dev/null | head -3 | while read -r f; do
echo "--- $f ---"
head -40 "$f"
done
[ -z "$(ls ~/Library/Logs/DiagnosticReports/iCleaner* 2>/dev/null)" ] && echo "(No crash reports; the app is not crashing)"
if [ "$RUN" -eq 1 ]; then
line "Running in foreground (Ctrl-C to quit)"
echo "Crashes or dyld errors will be printed below:"
"$APP/Contents/MacOS/iCleaner"
echo "Exit code: $?"
fi
line "App logs (last 10 minutes)"
log show --predicate "subsystem == \"$SUBSYSTEM\"" --last 10m --info --debug 2>/dev/null \
| tail -60
echo
echo "(Live: log stream --predicate 'subsystem == \"$SUBSYSTEM\"' --level debug)"