Skip to content

Instantly share code, notes, and snippets.

@andyscott
Created September 29, 2015 19:29
Show Gist options
  • Save andyscott/eacc796d90ed6c0e31c5 to your computer and use it in GitHub Desktop.
Save andyscott/eacc796d90ed6c0e31c5 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
# find path to most recently updated simulator log
LOG_PATH=`find ~/Library/Logs/CoreSimulator/*/system.log -type f -print0 | xargs -0 stat -f "%m %N" |
sort -rn | head -1 | cut -f2- -d" "`
green=`tput setaf 2`
reset=`tput sgr0`
# formatter
FORMAT () {
while read data; do
echo $data | sed "s/.*'\(.*\)'$/${green}>${reset} \1/g"
done
}
# tail -> format
tail -f $LOG_PATH | FORMAT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment