Is there a way to import contacts automatically from my Mac OS X Address Book into the iPhone Simulator Contacts app? Or vCards or anything like that? I'm building an app that displays contacts in various ways and I'd like to have a way to have lots of contacts without typing them all in myself.
相关问题
- CALayer - backgroundColor flipped?
- Core Data lightweight migration crashes after App
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- State preservation and restoration strategies with
相关文章
- 现在使用swift开发ios应用好还是swift?
- UITableView dragging distance with UIRefreshContro
- Could I create “Call” button in HTML 5 IPhone appl
- TCC __TCCAccessRequest_block_invoke
- Where does a host app handle NSExtensionContext#co
- Unable to process app at this time due to a genera
- Swift - hide pickerView after value selected
- How do you detect key up / key down events from a
djibouti33's answer worked for me as well, but there is one key exception in his steps for the iPhone Simulator folder location. Below worked for me.
Hope this helps!
This solution worked for me, and was incredibly easy.
The question asks about how to get Mac OSX contacts into the iOS Simulator. If you sync your iPhone with your Mac, then perform an unencrypted backup of your iPhone in iTunes, this solution will work:
I have Xcode 6, and when I drop a vCard file into the simulator window, it gives me the option to import.
So go to your Mac OS X address book, select all contacts and export them to a vCard. Then drag and drop that file into the simulator.
You can do this very simple:
Just download this app: https://github.com/aussiegeek/AddressBookVcardImport
Create a vCard with all the contacts you want to import and name it "vCards.vcf"
Add this file to the XCode Project and run it on the simulator.
Probably not directly, but it you have a real phone populated with contacts you could retrieve the file
/mobile/Library/AddressBook/AddressBook.sqlitedb
and copy it to~/Library/Application Support/iPhone Simulator/User/Library/AddressBook/AddressBook.sqlitedb
on your dev machine.If you've a jailbroken phone, copy
/var/mobile/Library/AddressBook/*
from your iPhone to~/Library/Application Support/iPhone Simulator/[version]/Library/AddressBook
on your Mac. Unfortunately, the pictures don't work for me even though I copiedAddressBookImages.sqlitedb
as well.