Skip to content

Instantly share code, notes, and snippets.

@odnoletkov
Created July 31, 2015 18:22
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
Lookup sandbox directory of the most recently launched application in iOS Simulator
#!/bin/sh
device_file=$(find ~/Library/Developer/CoreSimulator/Devices/*/data/var/run/launchd_bootstrap.plist -print0 | xargs -0 stat -f "%m %N" | sort -rn | head -n 1 | cut -d " " -f 2-)
device=${device_file%/*/*/*}
#echo $device
app_caches=$(find ${device}/Containers/Data/Application/*/Library/Caches -d 0 -print0 | xargs -0 stat -f "%m %N" | sort -rn | head -n 1 | cut -d " " -f 2-)
#echo $app_caches
app=${app_caches%/*/*}
echo $app
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment