views:

77

answers:

2

Hello everyone

Im in the process of pre populating a sql file and would like to know where Xcode keeps its folders for apps for the device. For example, the folders to get the apps on the simulator is /username/library/application support/simulator. Can someone please tell me where these folders are for the device? Any help is appreciated.

+1  A: 

It's in the build folder inside the project folder under release. So projectFolder/build/appName.build/release. The name of the actual folder on the end may change depending on targets and what not.

However, if you have some idea of putting a file directly into to the build forget it. Only items put inside the app bundle by the properly signed compiler will work. The code signing mechanism will not allow you to add anything post compile.

Instead, add the SQL file to the project itself and add it to the release target. When you build the release, the SQL file will be included inside the app bundle. I do this rather a lot.

TechZen
Ive replaced the database sql for core data directly on the simulator and it worked just fine. Im pre populating this with a mac app I created to do the work. I believe swapping the sql should work. Thanks for the help.
Tanner
The simulator has the app directories like you'd find on device AFTER the app has been installed. You can add files directly to those because the simulator has no directory security. Those directories do not exist in the release build itself because that is just the app bundle i.e. `AppName.app`. You can't add files to the release builds app bundle in any other way save by adding to the project and building into the app bundle. Period. End of Discussion.
TechZen
A: 

Using CoreData plus SQLite i see that the sqlite store file is put into the /Documents directory of my App in the iPhoneSimulator, if you want to get that path precisely you can use this method:

NSString * documentsDirectory = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) 
                                 objectAtIndex:0];
rano