Last active
May 15, 2023 15:28
-
-
Save nickcheng/cbc0717d2c9f79613cf2c042503b5422 to your computer and use it in GitHub Desktop.
Open your app's Documents folder on iOS simulator.
This file contains 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
function myappdocdir() { | |
devid=$(xcrun simctl list devices | grep Booted | sed -n 's/^.*\([A-F0-9]\{8\}-\([A-F0-9]\{4\}-\)\{3\}[A-F0-9]\{12\}\).*$/\1/p') | |
for folder in ~/Library/Developer/CoreSimulator/Devices/$devid/data/Containers/Data/Application/*; do | |
if [[ -a $folder/.com.apple.mobile_container_manager.metadata.plist ]]; then | |
if [[ 'com.apple.phone' = $(/usr/libexec/PlistBuddy -c 'Print :MCMMetadataIdentifier' $folder/.com.apple.mobile_container_manager.metadata.plist) ]]; then | |
echo $folder | |
break | |
fi | |
fi | |
done | |
} | |
alias cdapp='cd $(myappdocdir)' | |
alias openappdir='open $(myappdocdir)' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Put these code into your
.zshrc
.Replace
com.apple.phone
with your own's bundle ID.