Does anyone know if there is a way to add a contact via adb or monkeyrunner?
Using
device.shell("am start -a android.intent.action.ACTION_INSERT -t ContactsContract.Contacts.CONTENT_TYPE -e ContactsContract.Intents.Insert.NAME "+name+" ContactsContract.Intents.Insert.PHONE "+number)
does not work for me
Try adb shell input keyevent 3 This will take your phone back to the home screen which will automatically save the contact. Save this answer.
Enable adb debugging on your deviceTo use adb with a device connected over Wi-Fi, see Connect to a device over Wi-Fi. On Android 4.2 and higher, the Developer options screen is hidden by default. To make it visible, go to Settings > About phone and tap Build number seven times.
To dial (not call) a number from ADB, open a terminal or command prompt window on your Linux or Windows machine and run the following ADB shell command. $ adb shell service call phone 1 s16 "+6512345678" Result: Parcel(00000000 '....') Modify the number “ +6512345678 ” with the number that you want to dial.
Use something like this:
device.shell("am start -a android.intent.action.INSERT -t vnd.android.cursor.dir/contact -e name 'Donald Duck' -e phone 555-1234")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With