In the last years I've been using an iPhone and I recently wanted to transfer the contact list to my phone with Ubuntu Touch. These are the steps I followed.
What is required:
- Mac OSX.
- Ubuntu Desktop.
- Ubuntu Touch device.
How to do it:
- Export Contacts from the iPhone.
- Transfer the contact file to Ubuntu Touch.
- Import the contact file.
Let's go step by step.
Exporting the Contact list
There are different ways to export the Contact list from the iPhone to elsewhere. One option is to install an application like My Contacts Backup, and then to transfer the file containing the contacts to the computer. This option is preferred because avoids the need of a Mac desktop.
In my case, I already had my iPhone contacts synchronized with iCloud (option that I don't remember to have activated) and had the MacBook Air at hand. So these are the steps that I followed. First, the iCloud account must be setup to synchronize Contacts. Open Contacts in OSX, go to application menu and press to Accounts...
And export them.
Give a name to the file, and we are done in OSX.
The /Users/<user>/Documents/phone-contacts.vcf is a text file in vCard format that contains all the details of our contacts. Use a USB key to copy that file and copy it to an Ubuntu desktop.
Once the file is in Ubuntu desktop, we need to tweak it a little bit, since the import tool in Ubuntu Touch doesn't like the vcf file as exported directly by OSX. The problem is that each contact entry in the file is not separated by a new line, so it must be added afterward. Open a Terminal and type this command:
$ cat phone-contacts.vcf | sed -e "s/END:VCARD/END:VCARD\n/" > phone-contacts-touch.vcf
A new (and correct) file will be created, phone-contacts-touch.vcf.
Transfer to Ubuntu Touch
Now connect the Ubuntu Touch device to Ubuntu desktop and install some packages:
$ sudo apt-get install phablet-tools android-tools-adb
In the Ubuntu Touch phone, go to System Settings > About this phone > Developer Mode and enable the developer mode. Connect the phone to Ubuntu via USB and type this command to transfer the file to Ubuntu Touch:
$ adb push phone-contacts-touch.vcf /home/phablet/Documents
And log into Ubuntu Touch:
Importing the contacts
And now, the final step that will import the contacts. That will be done using SyncEvolution tool that comes by default in Ubuntu Touch.
$ syncevolution --import ~/Documents/phone-contacts-touch.vcf backend=evolution-contacts database=Personal
And that's it. Now, all the contacts are imported and available in the Address Book app in Ubuntu Touch. Enjoy!
Of course, with some development effort this task could be much easier. A path that I don't know whether it is possible are direct calls to iCloud API's from Ubuntu Touch, but I doubt it. I've took a quick look to libimobiledevice library. Many years ago there was a tool, python-idevicesync, that was based on it and provided a contact export feature. It's now out of sync with the library API. Another good step would be an Ubuntu Touch app that could read vCard files, and avoid the need to call SyncEvolution using the command line. I'm sure the community will be looking into this features soon.