5

有谁知道是否有办法通过 adb 或 monkeyrunner 添加联系人?

使用

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)

不适合我

4

1 回答 1

12

使用这样的东西:

device.shell("am start -a android.intent.action.INSERT -t vnd.android.cursor.dir/contact -e name 'Donald Duck' -e phone 555-1234")
于 2011-06-18T06:53:23.627 回答