zoukankan      html  css  js  c++  java
  • adb 命令 pc端 "复制粘贴" 文本到android设备

    假如你像我一样在寻找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 help
    Error: Unknown command: help
    usage: input ...
           input text <string>
           input keyevent <key code number or name>
           input [touchscreen|touchpad] tap <x> <y>
           input [touchscreen|touchpad] swipe <x1> <y1> <x2
           input trackball press
           input trackball roll <dx> <dy>


    作者:proud2008
    链接:https://www.jianshu.com/p/d818290f70e5/
    来源:简书
    简书著作权归作者所有,任何形式的转载都请联系作者获得授权并注明出处。
  • 相关阅读:
    [BJOI2015]树的同构 && 树哈希教程
    「HNOI2014」世界树
    CF613D Kingdom and its Cities
    「HEOI2014」大工程
    虚树教程
    [SDOI2011]消耗战
    CF1216E Numerical Sequence
    vim8.1安装
    luoguP5024 保卫王国
    动态DP教程
  • 原文地址:https://www.cnblogs.com/soundcode/p/15580199.html
Copyright © 2011-2022 走看看