Cleaning up the iPhone simulator

前端 未结 15 1443
情话喂你
情话喂你 2020-11-30 17:21

Is there a straightforward way to clean up the directory where xcode deploys an app when building for the iPhone simulator? I have a sqlite database that gets copied into t

15条回答
  •  暖寄归人
    2020-11-30 18:05

    As I was explaining in a comment under the validated answer:

    I was testing adding and removing calendar subscriptions. On a real device, you can remove a calendar subscription in Settings, Accounts but this menu does not exist in iOS Simulator and I did not want to reset the whole simulator.

    So I ended up locally versioning my Device folder with git and perform the following commands to remove a calendar subscription after I added it:

    $ git reset HEAD --hard
    $ git clean -f
    

    So the steps are:

    1. Install your application on the iOS Simulator and do what you have to do
    2. Identify your device in ~/Library/Developer/CoreSimulator/Devices/ and do a cd to it, then git init to create a git repository
    3. Once you want to save the state, perform git commit -a "Message"
    4. Do whatever changes the settings (ex: adding a calendar subscription) and perform your tests
    5. Shutdown the simulator
    6. Do git reset --hard HEAD
    7. Start the simulator, all changes done after git commit are gone.

提交回复
热议问题