Reputation: 412
I want to access an sqlite database file which I have bundled to my iOS application. This works fine, because I can see I can read/write from/to the database by the application logic. If I run the application by the simulator I can find the database here:
file:///Users/<Username>/Library/Developer/CoreSimulator/Devices/<DeviceID>/data/Containers/Bundle/Application/<ApplicationID>/<AppName>/test.db
But if I run the application on a real device it seems difficult to access the data, In Xcode I've tried to export the container in "Devices and simulators", download it, open the package content of the .xcappdata file but I can't find the file "test.db":
Where and How can I access the file?
Upvotes: 0
Views: 372
Reputation: 3219
Xcode will not import the Application part which contains the binary and all the files you bundle with it. When working with an file which is bundled in your app it is better to copy it into Library or Document directory the first time the application is run. So you never modify the bundle one which should only be a init file and not a working file. When it is in Document or Library, you can then get it via xCode.
Upvotes: 1