Skip to content

Instantly share code, notes, and snippets.

@chihchun
Created May 13, 2014 11:11
Show Gist options
  • Save chihchun/d4b47095de0cdbc4a32a to your computer and use it in GitHub Desktop.
Save chihchun/d4b47095de0cdbc4a32a to your computer and use it in GitHub Desktop.
script to log everything when debugging ubuntu touch
!/bin/bash
tmpdir=$(mktemp -d /tmp/ubuntutouch-$(date +"%Y%m%d%H%M")-XXX)
LANG=en_US.UTF8
PS1="$ "
export PS1
adb wait-for-device
adb shell system-image-cli -i > system-image.txt
adb shell getprop > getprop.txt
adb shell cat /proc/version > kernel.txt
adb shell dmesg > dmesg.txt
tmux new-session -d 'adb shell tail -f /var/log/syslog|tee -a syslog' \; \
split-window -d -v "/usr/bin/script -q -t screenlog -c \"bash --norc -c 'adb shell'\" 2> screenlog.timing" \; \
split-window -d -h "adb shell /system/bin/logcat | tee logcat.txt" \; \
attach
echo "log stored at $tmpdir"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment