Last active
November 13, 2023 14:05
-
-
Save atika/2766a42131a5cd1896f0 to your computer and use it in GitHub Desktop.
Open the iOS Simulator folder containing -user defaults- plists files for your Application
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/bash | |
appname="$1" | |
[ -z $appname ] && read -p "Application name : " appname | |
apppath=$(find ~/Library/Developer/CoreSimulator/Devices/ -name "$appname.app" -print -quit) | |
if [[ ! -z $apppath ]]; then | |
echo "Found path for $appname app" | |
echo -e "\033[1;30m$apppath\033[0m" | |
appbundle=$(osascript -e "id of app \"$apppath\"") | |
plists=$(find ~/Library/Developer/CoreSimulator/Devices/ -name "$appbundle.plist" -print -quit) | |
if [[ ${#plists} -gt 0 ]]; then | |
echo -e "\033[1;32mUserDefaults found for $appname, open folder with finder.\033[0m" | |
while read line; do | |
/usr/bin/open $(dirname "$line") | |
done < <(echo "$plists") | |
else | |
echo -e "\033[31mNo UserDefaults plist found for $appname\033[0m" | |
fi | |
else | |
echo -e "\033[31mNo application found by that name: $appname.app\033[0m" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment