Created
February 28, 2012 15:38
-
-
Save neonichu/1933225 to your computer and use it in GitHub Desktop.
Find the app which ran most recently in the iPhone simulator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| ## Find the app which ran most recently in the iPhone simulator | |
| SIM_DIR="$HOME/Library/Application Support/iPhone Simulator" | |
| lastapp="`mdfind -onlyin "$SIM_DIR" "kMDItemContentType = \"com.apple.application-bundle\""|head -n 1`" | |
| if [ -z "$1" ] | |
| then | |
| echo "$lastapp" | |
| exit 0 | |
| fi | |
| if [ "$1" == "-id" ] | |
| then | |
| dir="`dirname "$lastapp"`" | |
| echo "`basename "$dir"`" | |
| exit 0 | |
| fi | |
| echo "usage: $0 [-id]" | |
| exit 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment