android 命令行查询,从命令行查询Android内容提供商(adb shell)

有一个内容命令:

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, e.g 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}:

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值