Skip to content

Instantly share code, notes, and snippets.

@odnoletkov
Created July 31, 2015 18:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save odnoletkov/02286c9a8aafe29facac to your computer and use it in GitHub Desktop.
Save odnoletkov/02286c9a8aafe29facac to your computer and use it in GitHub Desktop.
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