iSaravanan
iSaravanan

Reputation: 125

where can i find sms.db file in my iphone using iPhone app

I have requirement that is i need to read sms message using in my iphone app. I know this only possible in jailbroken iPhone. My iPhone also jailbroken device. but i not able to get sms.db file. where can i find sms database can any one help me, give me some sample source code.

Upvotes: 1

Views: 21496

Answers (3)

user2216791
user2216791

Reputation: 49

Apps run in a sandbox on the iPhone and because of Apple Mobile Security, they do not allow these apps to access private data. This is done to protect the owner.

No one wants a malicious piece of software being ran on their iPhone and reading all their texts. You can, however, run a command on the iPhone or from your computer to copy the files down to a PC. This is what iTunes does to backup SMS messages.

App to private folder communication cannot happen though.

Upvotes: 0

Bhavin
Bhavin

Reputation: 27225

sms.db file is located in /private/var/mobile/Library/SMS/sms.db. You can simply access it through any favorite program (such as iPhone Explorer) and browse to this location.

Sample Code :

NSString* path = @"/var/mobile/Library/SMS";
NSError* error = nil;
NSArray* files = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:path error:&error];

Upvotes: 2

user529758
user529758

Reputation:

It's located in /var/mobile/Library/SMS/sms.db.

Upvotes: 1

Related Questions