简体   繁体   English

将联系人从 iPhone 模拟器导出到 iPhone 设备

[英]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.谢谢。

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 ~/Library/Application Support/iPhone Simulator/User/Library/AddressBook/AddressBook.sqlitedb但我不确定如何将其传输到设备

I have not tried this but you can save contacts as nsdata (using archiving) when you run on simulator.我没有尝试过,但是当您在模拟器上运行时,您可以将联系人保存为 nsdata(使用存档)。 Extract the nsdata and save individual contact using ABAddressBookAddRecord to the phone.提取 nsdata 并使用 ABAddressBookAddRecord 将个人联系人保存到手机。

For running different codes on simulator and device:在模拟器和设备上运行不同的代码:

#if (TARGET_IPHONE_SIMULATOR)
//simulator code

#else
//iphone code

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM