jorjap
jorjap

Reputation: 358

Export contacts from iPhone simulator to iPhone device

Does anyone know if this is even possible? If it is possible how can I do this? Thanks.

Upvotes: 0

Views: 852

Answers (2)

visakh7
visakh7

Reputation: 26400

You can get the contact database in simulator from here. ~/Library/Application Support/iPhone Simulator/User/Library/AddressBook/AddressBook.sqlitedb but I am not sure how you can transfer it to device

Upvotes: 2

Bushra Shahid
Bushra Shahid

Reputation: 3579

I have not tried this but you can save contacts as nsdata (using archiving) when you run on simulator. Extract the nsdata and save individual contact using ABAddressBookAddRecord to the phone.

For running different codes on simulator and device:

#if (TARGET_IPHONE_SIMULATOR)
//simulator code

#else
//iphone code

Upvotes: 0

Related Questions