How to add contacts using adb without user interaction? Following this I found out how to add a contact using adb. The only thing that's bugging me is that the user has to okay/cancel the action, because a create-contact dialog appears on the screen. What I want is for the command to automatically add the contact without waiting for the approval of the user. I've already looked through this, but couldn't find a way. Does anyone know how to do this?
For your Android 4.4.2 device the command to add a contact is (replace the Bo Lawson and #123.. to whatever you want): 

adb shell am start -a android.intent.action.INSERT -t vnd.android.cursor.dir/contact -e name 'Bo Lawson' -e phone 123456789


Now to get it to save. This is Android 4.4.2 specific. Pressing back will save it. For this you need to use key events. With Android 4.4.2 it is key event 4. You are going to need to do it at least twice.  Once to exit the keyboard, the other to exit and save. If required use it again to completely exit from Contacts app.


adb shell am start -a android.intent.action.INSERT -t vnd.android.cursor.dir/contact -e name 'Bo Lawson' -e phone 123456789
adb shell input keyevent 4
adb shell input keyevent 4


This worked on my rooted Samsung Galaxy Tab Pro running Android 4.4.2.

Edit: I found a post on Stack Overflow which references this command.