GithubHelp home page GithubHelp logo

exert-adb's Introduction

exert-adb

adb 命令

# 查看文档
adb help

# 列举设备
adb devices -l

# 安装软件
# -s 指定设备
adb -s emulator-5554 install /path/to/app.apk

# 进入 shell
# -s 指定设备
# 进入后 exit 可退出
adb -s emulator-5554 shell
# 后接命令可直接执行并打印结果
adb -s emulator-5554 shell ls

# 下载文件
adb pull /remote/path /local/path

# 上传文件
adb push /local/path /remote/path

截屏和录像

# 截屏
adb shell screencap /sdcard/screen.png

# 录像
adb shell screenrecord /sdcard/demo.mp4 --time-limit 10

关闭签名验证

修改 /system/build.prop 文件,去掉签名验证。

# 查看
adb shell getprop ro.install.3rd_cert

# 设置为不验证
adb shell setprop ro.install.3rd_cert false

# 重启
adb shell reboot

# 确保文件权限为 644 ,默认是 644,不是时需手动修改。
# 如果权限不够,进入 shell 处理。
adb shell chmod 644 /system/build.prop

设置

# 设置经纬度
adb -s emulator-5554 emu geo fix 116.770473 23.463044

前向/反向代理

# 列举前向代理
adb forward --list

# 设置前向代理
# adb forward tcp:<host_port> tcp:<avd_port>
adb -s emulator-5554 forward tcp:8080 tcp:8081

# 删除
# adb forward --remove tcp:<host_port>
adb forward --remove tcp:8080
# 这种方式只能 模拟器到本地主机,如果要内网,加多个反向代理
# adb reverse tcp:<avd_port> tcp:<host_port>
adb -s emulator-5554 reverse tcp:8081 tcp:8080

# 列举反向代理
# adb reverse --list
adb reverse --list
adb -s emulator-5554 reverse --list

# 删除反向代理,tcp:<avd_port>
# adb reverse --remove tcp:<avd_port>
# 删除所有反向代理
# adb reverse --remove-all
adb reverse --remove tcp:8081

使用 telnet 链接 模拟器管理器

# 指定 host 和 port 链接
telnet localhost 5554

# 进入连接会话后需要认证
# 会有提示你在某个路径下打开文件找到token 
# auth <token>
auth token123456

# 列出重定向列表
redir list

# 设置重定向
# redir add protocol:host-port:guest-port
# protocol 只能是 tcp 或 udp
# host-port 宿主这边
# guest-port 虚拟机
redir add tcp:host-port:guest-port

# 删除
redir del protocol:host-port

exert-adb's People

Contributors

chaosannals avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.