Skip to content

Instantly share code, notes, and snippets.

@rpetrich
Created November 9, 2013 08:03
Show Gist options
  • Save rpetrich/7382978 to your computer and use it in GitHub Desktop.
Save rpetrich/7382978 to your computer and use it in GitHub Desktop.
Basic crash debugging script
#!/bin/bash
# Basic iOS Crash Debugging Helper Script by rpetrich
apt-get install jp.ashikase.symbolicate grep curl coreutils coreutils-bin > /dev/null
if [ $? -ne 0 ]; then
echo "Unable to install debug script dependencies!" >&2
echo "Run script as root and make sure you have exited Cydia." >&2
exit 1
fi
IFS='|' read -r code url < <(
(
echo "### $HOSTNAME ###"
df -h
echo "### Latest SpringBoard Crash ###"
symbolicate /var/mobile/Library/Logs/CrashReporter/LatestCrash-SpringBoard.plist
if [ -e /var/log/syslog ]; then
echo "### Uncaught Exceptions ###"
grep "due to uncaught exception" /var/log/syslog
fi
echo "### Installed Packages ###"
dpkg -l | grep '^ii' | cut -b 5-
) | curl -c ~/.ghostbin/cookie.jar -b ~/.ghostbin/cookie.jar -fs -w '%{http_code}|%{redirect_url}' --data-urlencode text@- --data-urlencode lang=text http://ghostbin.com/paste/new
)
if [[ $code -ne 200 && $code -ne 303 && $code -ne 302 ]]; then
echo "Error uploading log to ghostbin!" >&2
exit 1
fi
echo "$url"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment