Importing AddressBook data into the iPhone Simulator

社会主义新天地 提交于 2019-11-27 10:33:11

问题


Is there an easy way to import AddressBook data into the iPhone Simulator?

Right now my only assumption is to manually modify the SQLite files found in the /Library/Application Support/iPhone Simulator/User/Library/AddressBook.


回答1:


I was looking for the exact solution, and this worked perfectly for me on a non-jailbroken phone. It works by extracting your iPhone address book from an unencrypted backup.

  • Quit the iOS Simulator
  • Download iPhone/iPod Touch Backup Extractor
  • Run it, and select the last option "iOS Files"
  • Create a folder on your desktop and extract all files to that folder
  • When complete, go to your extract folder and navigate to Library/AddressBook
  • Copy both files (AddressBook.sqlitedb and AddressBookImages.sqlitedb) to: ~/Library/Application Support/iPhone Simulator/{SDK}/Library/AddressBook
  • Run the Contacts application in iOS Simulator



回答2:


DummyContacts is an application that allows you to add Contacts to AddressBook and can be a handy tool for all iOS devices as well as simulators. DummyContacts is a life saver and pretty easy to setup. One click adds 100 records and one click also removes all 100. It also supports iOS6. So check it out at : https://github.com/Janak-Nirmal/DummyContacts .




回答3:


Here's a simple app I've made which you can install in the simulator https://github.com/cristianbica/CBSimulatorSeed




回答4:


Just sign in to your iCloud account on the simulator and turn "Contacts on" under iCloud. All your contacts, photos etc will appear on the simulator. Obviously, this assumes you are backing up your contacts to iCloud on your iPhone. Hope it helps!




回答5:


or if your iPhone isn't jailbroken, you can extract the sqlite db from a backup using the shell script here: http://0xced.blogspot.com/2009/01/using-your-own-address-book-in-iphone.html

(note you'll need to change the simulator path it copies it to, as in the current SDK it's a bit different due to the addition of the OS version folder - easiest thing would be to just change it to your home directory and copy manually from there)




回答6:


As Marc pointed in his answer https://stackoverflow.com/a/27582281/4598931 for a similar question it can be done just exporting contacts to vCard and drag and drop the generated file to iphone simulator.




回答7:


Right this is the only way i know with a "legit" iPhone

But if you have a jailbroken iPhone, you can download the iPhone AddressBook database with ssh, and replace the simulator one by the iphone one.



来源:https://stackoverflow.com/questions/901132/importing-addressbook-data-into-the-iphone-simulator

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!