adb 命令 pc端 "复制粘贴" 文本到android设备
16lz
2021-12-04
假如你像我一样在寻找android下通过命令复制粘贴的方法。
不过android上是没有直接进行复制粘贴剪切板的命令,只有间接实现:
1、android设备
首先android设备上,要把光标焦点定位到需要输入的文本框,比如当你输入用户名密码的时候
2、PC端
电脑上adb连接好android设备
cmd 命令行
1、adb shell input text hell0
则hello自动的填到获得焦点的输入框了
2、adb shell input keyevent 61
输入tab键定位到下一输入框,
tab键的key code是61 --> "KEYCODE_TAB"
adb shell input keyevent 61
adb shell input keyevent 3
adb shell input keyevent 82
具体数值 看android源码 android.view.KeyEvent.java
KEYCODE列表
3、input的命令
C:\Users\Administrator>adb shell input helpError: Unknown command: helpusage: input ... input text input keyevent input [touchscreen|touchpad] tap input [touchscreen|touchpad] swipe
参考
更多相关文章
- 深入解读Linux与Android的相互关系
- Android(安卓)File Transfer – 在 Mac 上也能读取 Android(安卓
- android基础知识17:Android设备常见问题与测试要领
- 深入解读Linux与Android的相互关系
- Android(安卓)4.0 input touch解析(一)
- Android实时抓包分析 : 善用adb调试桥
- 深入解读Linux与Android的相互关系
- android的wifi网卡移植详细过程已经通用驱动的问题
- 使用android--建立第一个APP程序