开发者

Adding a contact via adb or monkeyrunner

开发者 https://www.devze.com 2023-03-14 05:31 出处:网络
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

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")
0

精彩评论

暂无评论...
验证码 换一张
取 消