Exporting an application database file from my iPhone development to a computer

I have an iPhone app that I plan to use for research purposes. Since testers use the application on my development phone, it stores analytics data in a local database (right now SQLite, but I do not mind switching to CoreData).

After testing is complete, I will need to copy this analytics database from the phone to my computer so that I can run data queries. What is the easiest way to do this? If necessary, I will iterate over the data, print it in the device log and then import it back into the database on the desktop, but I would like to find a way to just capture the .sqlite file without running it through an intermediate format.

+3
source share
4 answers

You can use Xcode Organizer to download an archived snapshot of your Documents and Libraries application from your device.

+1
source

You can always try to print it in PDF format using UIKit - this is an easy way to export information and generate it in a simple form if you do not think that this method cannot be applied to your database;)

Do you know if we can send SQLite database email directly from an iOS device?

+1
source

- Info.plist UIFileSharingEnabled ( , YES), - :

NSString *docsPath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject];
[[NSFileManager defaultManager] copyItemAtPath:whereverTheDatabaseIs toPath:[docsPath stringByAppendingPathComponent:@"exported.sqlite"] error:NULL];

, iTunes malarkey.

- , . : , , , .

0

Thanx ole begemann.

, "". .xcappdata.
.zip, , InApp finder. .

0

Source: https://habr.com/ru/post/1774559/


All Articles