Android常用命令—setting/input

一、settings 命令

1. settings 提供的设置命令:

helip  打印此txt

get [--user <USER_ID> | current] NAMESPACE KEY  检索 KEY 的当前值。

put [--user <USER_ID> | current] NAMESPACE KEY VALUE [TAG] [default]  将 KEY 的内容更改为 VALUE。与设置相关联的 TAG。{default} 设置为默认值,仅对全局/安全命名空间不区分大小写。

delete [--user <USER_ID> | current] NAMESPACE KEY  删除 KEY 的条目。

reset [--user <USER_ID> | current] NAMESPACE {PACKAGE_NAME | RESET_MODE}  为具有模式的包重置全局/安全表。RESET_MODE 是 {untrusted_defaults, untrusted_clear, trusted_defaults} 之一,不区分大小写。

list [--user <USER_ID> | current] NAMESPACE  打印所有定义的键。NAMESPACE 是 {system, secure, global} 之一,不区分大小写。

2. settings put system pointer_location 1/0 //触摸轨迹球/指针位置显示与关闭

3. settings put system show_touches 1/0 //显示点按操作反馈开启/关闭

 

更多见:https://www.cnblogs.com/hellokitty2/p/10491828.html

 

二、input 命令

1. input 命令用法

用法:input [<source>] [-d DISPLAY_ID] <command> [<arg>...]

source 是 dpad keyboard mouse touchpad gamepad touchnavigation joystick touchscreen stylus trackball

-d 是指定 display id. 默认值:-1 表示按键事件,0 表示运动事件(如果未指定)。

命令和默认源是:
    text <string> (默认:触摸屏)
    keyevent [--longpress] <键码编号或名称> ...(默认:键盘)
    tap <x> <y>(默认:触摸屏) //点击
    swipe <x1> <y1> <x2> <y2> [持续时间(毫秒)](默认:触摸屏)//滑动
    draganddrop <x1> <y1> <x2> <y2> [duration(ms)](默认:触摸屏)//拖放
    press(默认:轨迹球)//按下
    roll <dx> <dy>(默认:轨迹球)//滚动
    event <DOWN|UP|MOVE> <x> <y>(默认:触摸屏)

2. 使用举例

input tap 300 500 //点击, 点击坐标[300,500]

input swipe 200 100 300 500 600 //滑动, 从[200,100] 经历600毫秒滑动到[300,500]

input swipe 200 100 200 100 600 //长按, 长按[200,100] 600毫秒

 

input 命令和 getevent -lrt 命令相反。

 

相关:

Android命令行工具使用总结: https://www.cnblogs.com/hellokitty2/p/12775628.html

 

posted on 2020-02-04 17:14  Hello-World3  阅读(3253)  评论(0编辑  收藏  举报

导航