Skip to content

Instantly share code, notes, and snippets.

@nickcheng
Last active May 15, 2023 15:28
Show Gist options
  • Select an option

  • Save nickcheng/cbc0717d2c9f79613cf2c042503b5422 to your computer and use it in GitHub Desktop.

Select an option

Save nickcheng/cbc0717d2c9f79613cf2c042503b5422 to your computer and use it in GitHub Desktop.

Revisions

  1. nickcheng revised this gist Apr 25, 2017. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions appdocdir.zsh
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,3 @@
    alias cdapp='cd $(myappdocdir)'
    alias openappdir='open $(myappdocdir)'
    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
    @@ -11,3 +9,5 @@ function myappdocdir() {
    fi
    done
    }
    alias cdapp='cd $(myappdocdir)'
    alias openappdir='open $(myappdocdir)'
  2. nickcheng revised this gist Apr 25, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion appdocdir.zsh
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,7 @@
    alias cdapp='cd $(myappdocdir)'
    alias openappdir='open $(myappdocdir)'
    function myappdocdir() {
    devid=$(xcrun simctl list devices | grep Booted | cut -d '(' -f 2 | cut -d ')' -f 1)
    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
  3. nickcheng revised this gist Apr 12, 2017. No changes.
  4. nickcheng created this gist Apr 12, 2017.
    13 changes: 13 additions & 0 deletions appdocdir.zsh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,13 @@
    alias cdapp='cd $(myappdocdir)'
    alias openappdir='open $(myappdocdir)'
    function myappdocdir() {
    devid=$(xcrun simctl list devices | grep Booted | cut -d '(' -f 2 | cut -d ')' -f 1)
    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
    }