Tutorial :How do I speed up app launch in iPhone Simulator?



Question:

The problem is that my app saves hundreds of megabytes into the users document directory on their iPhone. During testing, the iPhone simulator takes a long time to launch the app on each build as it is copying all of this data to a new documents directory each time I rebuild. Is there any solution to this that will just leave the directory in the same place each time or speed up launch in some way? For example, the director with HEX values change each rebuild/relaunch on the iPhone Simulator and it can be quite time consuming:

./Library/Application Support/iPhone Simulator/User/Applications/B32A0BA1-5843-4FDE-B5FB-4E40460BD8CC/Documents/

Thanks,

Matt


Solution:1

The simulator (unlike the device itself) doesn't have to keep to the sandboxed locations.

So when saving files from the simulator, you could try:

#if TARGET_IPHONE_SIMULATOR    // save your files to a fixed location on your hard-disk  // (like /Users/yourusername/MyIPhoneAppDebugStorage)    #else    // Save files normally  // (to [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,  //     NSUserDomainMask, YES) objectAtIndex:0])    





        
Previous
Next Post »