Skip to content

Instantly share code, notes, and snippets.

@chetstone chetstone/README.md
Last active Sep 13, 2018

Embed
What would you like to do?
Inspecting React-Native AsyncStorage in iOS Simulator

First, cd into the Async directory.

cd `xcrun simctl get_app_container booted $BUNDLE_ID data`/Documents/RCTAsyncLocalStorage_V1

Then review the manifest:

jq < manifest.json

Then to pretty-print a non-null value in the manifest:

jq '."somekey"|fromjson' < manifest.json

For null values, find the file that has the value:

md5 -s "otherkey"
90f5ba064f8280d4c94b1f0b1a85a79e

Then pretty-print that file:

jq < 90f5ba064f8280d4c94b1f0b1a85a79e

Helpful shell aliases

    export BUNDLE_ID=foo.bar.myApp
    alias cdasync='cd $(xcrun simctl get_app_container booted $BUNDLE_ID data)/Documents/RCTAsyncLocalStorage_V1'
    function jqkey {
        if  [[ $( cat  manifest.json | jq '.["'"$1"'"]' ) == null ]]
        then
            f=$(md5 -q -s $1)
            echo  NULL -- Printing file $f
            cat $f | jq
        else
            cat  manifest.json | jq '.["'"$1"'"]|fromjson'
        fi
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.