Where can I find an iPhone address book with sample data?
I'm developing an application that get access to the iPhone address book. The simulator contains only a few sample entries. I'd like to find a sample address book with thousands of entries with various cha开发者_开发问答racter set (English, Chinese, Arabic, etc) to fully test my app. Filling the address book myself will take for ever.
Basically I need a AddressBook.sqlitedb file with as much data as possible
A csv would probably do just fine if there is a way to transfer it into a sqlitedb file
Good question, I'll have to give this a go myself later, but just from combining a few things I found around the web the following might work for you:
Install Sun OpenDS and fill it with test data using the checkbox provided
Connect your Mac's address book app to this directory server on localhost and sync (will fill your local address book with the same sample data)
as described here: http://blogs.oracle.com/treydrake/entry/mac_address_book_and_opends
Sync to a real iPod/iPhone
Extract the resulting files from your iPhone/iPod's
/User/Library/AddressBook/
and copy into:
/Users/[your user name]/Library/Application Support/iPhone Simulator/[iOS version]/Library/AddressBook/
if your device is jailbroken 'Phone Disk' from macroplant.com is a convenient way to do this (but there are of course many others including SCP etc)
(if your device isn't jailbroken, you can extract the database from a backup using the shell script here: http://0xced.blogspot.com/2009/01/using-your-own-address-book-in-iphone.html just note you'll need to change the path it copies it to to the one above, or your home folder or something and copy manually, as the simulator path in that post is for the previous version of the SDK)
As a minor aside but related to address book testing, I'd highly recommend also adding an Exchange account on a real device (as you can't do that in the simulator) and testing with that - it threw up some bugs in our app (crash on attempting to access the address book).
精彩评论