Interroga il provider di contenuti Android dalla riga di comando (shell adb)

Esiste un comando per avviare un’attività basata sull’intento: am start . Anche per inviare una trasmissione: am broadcast .

Penso che probabilmente ci dovrebbe essere un comando shell per interrogare un content provider, probabilmente qualcosa del tipo:

 query content://com.myapp.authority/path --where 'column=?' --arg 1 --order 'column desc' 

o simili.

Ce n’è uno?

C’è un comando di content :

 usage: adb shell content [subcommand] [options] usage: adb shell content insert --uri  [--user ] --bind  [--bind ...]  a content provider URI.  binds a typed value to a column and is formatted: :: where:  specifies data type such as: b - boolean, s - string, i - integer, l - long, f - float, d - double Note: Omit the value for passing an empty string, eg column:s: Example: # Add "new_setting" secure setting with value "new_value". adb shell content insert --uri content://settings/secure --bind name:s:new_setting --bind value:s:new_value usage: adb shell content update --uri  [--user ] [--where ]  is a SQL style where clause in quotes (You have to escape single quotes - see example below). Example: # Change "new_setting" secure setting to "newer_value". adb shell content update --uri content://settings/secure --bind value:s:newer_value --where "name='new_setting'" usage: adb shell content delete --uri  [--user ] --bind  [--bind ...] [--where ] Example: # Remove "new_setting" secure setting. adb shell content delete --uri content://settings/secure --where "name='new_setting'" usage: adb shell content query --uri  [--user ] [--projection ] [--where ] [--sort ]  is a list of colon separated column names and is formatted: [:...]  is the order in which rows in the result should be sorted. Example: # Select "name" and "value" columns from secure settings where "name" is equal to "new_setting" and sort the result by name in ascending order. adb shell content query --uri content://settings/secure --projection name:value --where "name='new_setting'" --sort "name ASC" usage: adb shell content call --uri  --method  [--arg ] [--extra  ...]  is the name of a provider-defined method  is an optional string argument  is like --bind above, typed data of the form :{b,s,i,l,f,d}: