zoukankan      html  css  js  c++  java
  • Android手机无线adb

    数据线连不上问题

    手机读出来了,但是adb devices却不显示,这时候要下载adb interface,然后在设备管理器中更新驱动为下载的驱动(需解压)即可。

    adb offline问题

    adb版本问题,需要在adb命令中更换adb开头的文件和fastboot.exe

    查看系统变量,找到adb安装位置

    set ADB_HOME

    把和adb interface一起下载的压缩包中adb.zip的内容复制到ADB_HOME中

    再试一下,可以了

    adb连接手机

    1.首先电脑,手机通过数据线链接电脑,然后通过adb devices 查看到已连接

    2.输入:adb tcpip 5555       #restarts the adbd daemon listening on TCP on the specified port

    3.输入:adb connect 222.222.221.137:5555

    4.adb devices 在查看下,会发现有两个,这时把数据线移除即可

    ps:mumu模拟器  adb connect 127.0.0.1:7555

    adb查看logcat

    adb logcat可以打印全部

    查询应用的logcat

    adb shell
    logcat | grep "com.xxx"

    adb常用命令

    获取设备

    adb devices

    重启adb服务

    通常两个命令一起用,一般在连接出现异常,使用 adb devices 未正常列出设备, 设备状态异常时使用 kill-server,然后运行 start-server 进行重启服务

    结束 adb 服务

    adb kill-server

    启动 adb 服务

    adb start-server  

    adb pull

    将 Android 设备上的文件或者文件夹复制到本地 

    adb pull sdcard/pull.txt d:

    adb push

    推送本地文件至 Android 设备

    adb push d:push.txt sdcard/

    adb reboot

    重启 Android 设备

    adb forward端口重定

    adb forward tcp:1314 tcp :8888    #执行该命令后所有发往宿主机 1314 端口的消息、数据都会转发到 Android 设备的 8888 端口上,因此可以通过远程的方式控制 Android 设备

    常用按键

    adb shell input keyevent 26 # 电源键
    adb shell input keyevent 82 # 菜单键
    adb shell input keyevent 3 # HOME 键
    adb shell input keyevent 4 # 返回键
    adb shell input keyevent 24 # 音量+
    adb shell input keyevent 25 # 音量-
    adb shell input keyevent 164 # 静音 
    
    adb shell input keyevent 85 # 播放/暂停
    adb shell input keyevent 86 # 停止播放
    adb shell input keyevent 87 # 播放下一首
    adb shell input keyevent 88 # 播放上一首
    adb shell input keyevent 126 # 恢复播放
    adb shell input keyevent 127 # 暂停播放
    
    adb shell input keyevent 224 # 点亮屏幕
    adb shell input keyevent 223 # 熄灭屏幕
    
    # 触击屏幕
    adb shell input tap <X> <Y> # x,y为坐标位置
    
    # 滑动屏幕  四个参数:起始点x坐标 起始点y坐标 结束点x坐标 结束点y坐标。
    adb shell input swipe 300 1000 300 500 # 向上滑动
    adb shell input swipe 300 100 300 1000 # 向下滑动
    adb shell input swipe 1000 500 200 500 # 向左滑动
    adb shell input swipe 200 500 1000 500 # 向右滑动
  • 相关阅读:
    Vue 全局过滤器和局部过滤器使用方式
    Vue 标签显示/隐藏的方式对比demo
    OpenSSL SSL_read: Connection was reset, errno 10054
    Vue 自定义全局指令和局部指令demo
    Vue 列表渲染demo
    Vue Class样式和style样式编写
    vue中的函数(methods),计算属性(computed),监听器(watch)的区别demo
    Vue 常用指令
    针对 WebSocket 协议的 Locust 压测脚本实现(基于 Locust 1.0 以上版本)
    Locust 脚本开发入门(4)
  • 原文地址:https://www.cnblogs.com/aeolian/p/8279964.html
Copyright © 2011-2022 走看看