Adding a contact via adb or monkeyrunner
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.CONTEN开发者_高级运维T_TYPE -e ContactsContract.Intents.Insert.NAME "+name+" ContactsContract.Intents.Insert.PHONE "+number)
does not work for me
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")
精彩评论