How to import SMS backup file(CSV format) took from Android to iPhone

别等时光非礼了梦想. 提交于 2019-12-12 04:22:47

问题


I have a SMS backup(CSV format) file exported from Android where each record is the text message. I want this file to be imported to iPhone programmatically. Could anyone help me how to do this in iOS. I'm not getting any resource for doing this so for.

Any help is appreciated.


回答1:


Recently, I succeeded extracting message records from iPhone backups. I generally understand the mechanism/design of iPhone backups. So I hope I can give you some hints in theory to do it.

The possible steps:

  1. Create a unencrypted backup from iPhone to your OS X devices through iTunes. But make sure DO NOT check the option "Encrypt iPhone backup" since you are going to update (import your SMS backup) the backup.

  2. Find the backup you just have done. My OS X is 10.12.6, the directory is /Users/your user/Library/Application Support/MobileSync/Backup/

  3. Then, go into the directory Backup/ and find the directory for iPhone Message. Mine is /Users/myusername/Library/Application Support/MobileSync/Backup/7aded5a6a493ac0b3c41cc930a5421ca035610b5/3d/3d0d7e5fb2ce288813306e4d4636395e047a3d28 As I known, there is only one directory under Backup/, and the following path "3d/3d0d7e5fb2ce288813306e4d4636395e047a3d28" is all the same for every backup. So hopefully you will find it without problems.

  4. The file 3d0d7e5fb2ce288813306e4d4636395e047a3d28 is a SQLite DB. Copy and paste it to somewhere easier to reach for a SQLite visual tool called "DB Browser for SQLite". (If you prefer using command line just type sqlite to enter and use command ".open 3d0d7e5fb2ce288813306e4d4636395e047a3d28" to enter the DB)

  5. After you open 3d0d7e5fb2ce288813306e4d4636395e047a3d28 with SQLite you should see: Here are 10 database tables. The key tables are message (text, date, handle_id etc.) and handle (contact list).

  6. Now it's the time to use your SMS CSV file to import into the SQLite DB. To do this, you need the knowledge of inserting data to db from csv files, and the backup database schema by understanding the tables showing in the pic.

  7. After inserting your SMS CSV file, replace the 3d0d7e5fb2ce288813306e4d4636395e047a3d28 in the iPhone backup. Finally you can use iTunes to recover your iPhone from this backup.

Hope all above will give you some ideas. Cheers!



来源:https://stackoverflow.com/questions/38782269/how-to-import-sms-backup-filecsv-format-took-from-android-to-iphone

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