Can you please let me know if there is any adb command that can be used to find total number of contacts on device. -thanks in advance, Manju
this does not require root and sqlite
:
adb shell content query --uri content://contacts/phones/ --projection display_name:number:notes # google contacts?
adb shell content query --uri content://com.android.contacts/data --projection display_name:data1:data4:contact_id
There are a few adb
commands that appear to work (as of on Android 10).
adb shell content query --uri content://contacts/people/
Assuming you have a bash shell (Linux, OSX, or Windows Subsystem for Linux), you can pipe the output of those commands to wc -l
to get the count.
adb shell content query --uri content://contacts/people/ | wc -l
Other interesting commands include:
adb shell content query --uri content://contacts/phones/
adb shell content query --uri content://contacts/groups/
adb shell content query --uri content://contacts/groupmembership/
adb shell content query --uri content://contacts/organizations/
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