Clear iPhone simulator cookies

前端 未结 6 1092
野趣味
野趣味 2021-02-06 10:35

I have an app that makes request to a REST service. Authentication is done using cookies. This already works.

What I have problems with is to test the case when the cook

6条回答
  •  青春惊慌失措
    2021-02-06 11:25

    I just used fseventer to inspect what happens to the iPhone Simulator filesystem when the "Clear Cookies and Data" button is tapped. These commands replicate that behavior, however, there is a trick:

    rm -rf "$HOME/Library/Application Support/iPhone Simulator/5.0/Library/Cookies"
    rm -rf "$HOME/Library/Application Support/iPhone Simulator/5.0/Library/Caches/Snapshots"
    rm -rf "$HOME/Library/Application Support/iPhone Simulator/5.0/Library/Caches/com.apple.mobilesafari"
    rm -rf "$HOME/Library/Application Support/iPhone Simulator/5.0/Library/WebKit"
    rm -rf "$HOME/Library/Application Support/iPhone Simulator/5.0/Library/Safari"
    

    The Simulator needs to be restarted. So, before manipulating the filesystem, I run this:

    killall "iPhone Simulator"
    

提交回复
热议问题