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.
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.
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.
Related
When I plug my iPhone into the computer can I access an apps folder structure that's on the phone? Either programatically or manually with a tool that doesn't involve jailbreaking.
Have you tried iExplorer? See if that satisfies your requirements.(It doesn't need the device to be jailbroken).
It cant be done without jailbreaking, you basically must create your app folder structure with xcode.
I'm starting with an app that has foo.png as a resource, and the app is installed (either in the simulator or on the device). If I delete foo.png, do a clean build, etc., and install, then it still shows up in the bundle on the simulator or device!
But I know the file isn't in the bundle before copying to the simulator or device (for example:
I can see it's not there in the build folder.
If I delete the app from the simulator or device, and then install, then foo.png doesn't show up on the simulator or device.
So it seems that when updating, it doesn't replace the app bundle; instead, it only copies new files and replaces updated ones. (I can confirm that it does, in fact, copy and replace files properly.)
Why isn't it replacing the entire app bundle?
If you update your application through iTunes using an ad hoc build you will see that your .app bundle will be replaced completely and old resources, such as the foo.png file described in the original post will be removed.
Reset the simulator, go up to the menu and then click reset simulator. I always have that problem with databases on the device. You will have to delete it on the device. Just a quirk that I've experienced as well.
i developed an app which is meant to read books(pdf book reader).i loaded 25 books(total size of 320MB) into the app using absolute path.all the books are been seen in the simulator and also i can load all the books into my device through xcode(build and run).
my requirement:
when i loaded the above obtained ipa file into the same device or other device which are in ad-hoc distribution using itunes , it is strange that only few books are being seen in the device.
note: i made sure that all the books are present in the .ipa file,i deleted old app in the device which i run via xcode. the device is in ad-hoc distribution.
while code signing i used the iphone developer certificate.
is it necessary to use distribution certificate instead iphone developer certificate which i feel that might be one reason for my problem?
plz anyone suggest me with exact solution to the scenario.
tnx in advance
I know I have seen problems going from simulator to live device. The simulator is not case sensitive, but the device is. Recheck all your actual files in bundle vs what you are requesting when you open the file. They need to match exactly for device, but not so much for simulator.
I would also try seting the apps-Info.plst to have "Application supports iTunes file sharing" on so you could see what is in the documents folder (this is if your moving files in that area).
One problem might be as RAZ suggested that iPhone is case sensitive, but there could be other problems.
For starters I would check the that ipa does contain everything you think should be there. Take the ipa, change the extension to zip and open it. You'll get a folder containing you're app. Right click the .app and choose show package. You'll now see all the files/resources included in your app. If the files that won't load in the app are there then you'll need to provide more information about the problem.
If they're not you need to make sure xCode knows to copy them to the app resources.
You might have resources that you haven't copied into the project, and you're only referencing the files on your hard disk. Then when you make the .ipa file it's not included. Try re-importing all your resources and select "copy to project".
I would like to send someone the Xcode simulator version - not the device version - of my iPad app. I have located the .app file in the Finder. Do I just zip it up and send it off or is it more complicated than that?
Thanks,
Doug
UPDATE
Chrisbtoo got the answer on this one however he left of some critical bits for those of you trying this at home:
Path to Xcode simulator (the simulator can be run standalone.):
/Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone Simulator.app
Path to app that appears in the home screen of the simulator:
/Users/turner/Library/Application Support/iPhone Simulator/3.2/Applications/{GUID}
It is instructive to watch what happens in the app simulator directory as you build for simulation, delete apps from the simulator desktop and generally use the simulator as an actual device.
Bottom line: This is a viable approach for sharing apps in a "simulated" ad hoc manner without the mind numbing, soul sucking process of true ad hoc app sharing.
Cheers,
Doug
Assuming the other person already has the simulator installed, you can just zip up the stuff under ~/Library/Application Support/iPhone Simulator/3.2/Applications/{GUID} (includes both the .app and any data directories needed) and send it to them - they'll need to unzip it under that same directory. What I've done in the past was to rename the {GUID} part to a more friendly name - the sim will still pick it up.
If they don't already have the simulator, they will need to sign up for a free iphone dev account and download Xcode, etc.
We just put up a little tool that will help you with this. It manages both what you need on the dev side and also the tester.
Here it is
http://blog.placeit.net/ios-app-packager/
It basically creates a little zip that you can pass to the tester and it'll install the app in the right directory and also open it up for the user with the right device selected.
I would think you want to send the entire project folder to the other person- presumably you are expecting them to open it in their XCode- and presumably they have the sdk for the app.
You have to distribute via AdHoc or App Store for beta testing.
Become a developer and then look into how to do this.
You need to have a provisioning profile, and then select the UDID's for the device you want to beta test to.
Go to the iPhone Provisioning Portal
and here is a document with more detail
I have a lot of data stored in my app on my provisioned device, and I want to do additional testing on my computer which is much faster than using the device. What is the best way to transfer the data store into the iPhone simulator so I can access it on the computer?
I think that you can download the data from your device in the Organizer in Xcode.
Once you unzip that folder you should be able to find your sqlite database file.
Now look for the folder on your hard drive where the simulator keeps its files. I think it's somewhere in ~/Library/Application Support/iPhone Simulator or something like that. There should be a folder for each app somewhere in there (the folder name will be some random ID), and you should be able to find an sqlite database with the same name. Replace that database with the one you downloaded from the device.
Sorry I can't give more detailed instructions. I'm at work currently and don't have access to my Macbook to get the exact folder names and such.