views:

1497

answers:

2

Update:

The app is running on the device of an ad-hoc user.

I just want to delete a single application's data.


Original question:

Is there a way to completely wipe the an iPhone application's directory easily?

I want to delete preferences, documents, caches, everything.

I'd like to do this programmatically within the app so I could distribute it to an Ad-Hoc user.

Thanks.

A: 

Hi Corey,

It sounds like you have the app running in the simulator and you want to send it to an ad-hoc user? Technically, ad-hoc copies of the app need to be compiled for the ARM architecture and codesigned with an ad-hoc distribution certificate - so a copy from the simulator won't do any good.

If you just want the other person to run the app in their copy of the simulator, you can go to ~/Library/Application Support/iPhone Simulator/ and start deleting stuff, though.

Ben Gotow
This is for an ad-hoc distibuted app on a beta tester's device.
Corey Floyd
+2  A: 

Have them delete the app from their phone first. That will delete the application folder. Then they can install a fresh copy with no saved files in the app's directory.

Ken Pespisa
I didn't think app data was deleted when this happened. Do you have a document that verifies this?
Corey Floyd
I've been doing this for a while - since each app is sandboxed, all the data is stored within the app's directory. I know that this will reset settings, NSUserDefaults, etc.. as well.
Ben Gotow