Cleaning up the iPhone simulator

前端 未结 15 1314
情话喂你
情话喂你 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 17:53

    In XCode, go to the Window menu option, select Devices and then you can just delete the ones you no longer need.

    0 讨论(0)
  • 2020-11-30 17:58

    For Xcode <= 5

    I added the following to my ~/.bash_profile

    alias cleansim='rm -r ~/Library/Application\ Support/iPhone\ Simulator/5.1/Applications/*'
    

    It just nukes all of the apps on the sim.

    0 讨论(0)
  • 2020-11-30 17:59

    it may be overkill but..

    you can also use the menu and 'Reset Content and Settings...'

    0 讨论(0)
  • 2020-11-30 18:01

    From Apples Dev Resources:

    To set the user content and settings of the simulator to their factory state and remove the applications you have installed, choose iPhone Simulator > Reset Content and Settings.

    This resembles:

    0 讨论(0)
  • 2020-11-30 18:02

    As of Xcode 6:

    xcrun simctl erase <sim udid> <- resets the simulator.

    0 讨论(0)
  • 2020-11-30 18:05

    The simulator installs apps into:

    "$HOME/Library/Application Support/iPhone Simulator/User/Applications"
    

    Also check:

    "$HOME/Library/Developer/CoreSimulator/Devices"
    

    The GUID files and directories match up to the simulator's installed apps.

    Manually delete all those files/directories to remove all applications from the simulator.

    I know there is some way to add scripts to the build process in XCode.

    Also it looks as if XCode changes the GUID it uses each build (the directory where my app sits changes between builds in XCode), so trying to delete the same directory all the time won't work. If you are only working on one app at a time then clearing out the entire directory would be an option.

    0 讨论(0)
提交回复
热议问题