Android adb import contacts vcard
I received an error and shared this post for the solution for those who experienced this error. What happened to me and solutions. Adb shell add, edit, delete and all remove command.
First import command
adb push yourfile.vcf /sdcard/contacts.vcf
adb shell am start -t "text/x-vcard" -d "file:///sdcard/contacts.vcf" -a android.intent.action.VIEW com.android.contacts
Please note that the contact application should not be open. Everything is fine but I got an error message. This error is a read error.
Remember that, this method works if you don’t have a google account or have. However, the special commands I will share below such as bulk deletion do not work if the google account is connected.
Add Phone number adb shell
adb shell am start -a android.intent.action.INSERT -t vnd.android.cursor.dir/contact -e name Tolga -e phone +905319998887
Edit Phone number adb shell
adb shell am start -a android.intent.action.EDIT content://com.android.contacts/contacts/1
Remove Phone number adb shell
adb shell content delete --uri content://com.android.contacts/contacts/1
All contact list delete
adb shell pm clear com.android.providers.contacts
Get all contact list
adb shell content query --uri content://com.android.contacts/contacts