当前位置:网站首页>如何配置adb环境变量(环境变量在哪打开)
如何配置adb环境变量(环境变量在哪打开)
2022-07-28 12:12:00 【全栈程序员站长】
大家好,又见面了,我是你们的朋友全栈君。
1.配置ADB环境变量
1.1:打开控制面板 >系统和安全>系统>高级系统设置
1.2:在系统变量中新建ANDROID_HMOE变量,赋值路径(D:\install\androidSDK)
1.3.在系统变量path中添加%ANDROID_HOME%\platform-tools
1.4.cmd进入终端2. ADB常用指令
2.1.1.查看设备 2.1.2 开启/关闭服务 2.1.3.安装软件 2.1.4.卸载软件 2.1.5.查看所有app的包名 2.1.6.系统应用 2.1.7.查看已安装的第三方软件 2.1.8将电脑文件传输到移动端 2.1.9将移动端文件传输到电脑 2.2.0查看adb命令帮助信息 2.2.1截屏 2.2.2登录设备shell 2.2.3查看手机CPU情况 2.2.4查看应用内存使用情况 2.2.5显示磁盘使用信息 2.2.6清除应用缓存信息 2.2.6查看电池状态 2.2.7查看电池信息
配置ADB环境变量
1.1:打开控制面板 >系统和安全>系统>高级系统设置
1.2:在系统变量中新建ANDROID_HMOE变量,赋值路径(D:\install\androidSDK)
1.3.在系统变量path中添加%ANDROID_HOME%\platform-tools
1.4.cmd进入终端 验证adb配置是否成功 如下图显示为失败
如下图显示为成功
2. ADB常用指令
2.1.1.查看设备: 指令:adb devices 这个命令是查看当前连接的设备, 连接到计算机的android设备或者模拟器将会列出显示
2.1.2.开启/关闭服务: 开启服务 adb start-server 关闭服务 adb kill-server
启动错误示意图:
解决办法: 先打开一个命令行窗口 adb nodaemon server 回车后
再打开另外一个命令行窗口adb shell就成功了。
启动正确示意图:
这里为雷电模拟器
2.1.3.安装软件: 指令:adb install apk 路径: adb install E:\ceshi\baidu.apk
2.1.4.卸载软件: 指令:adb uninstall <软件名> adb uninstall com.baidu.searchbox 补充:adb uninstall -k <软件名> 如果加 -k 参数,为卸载软件但是保留配置和缓存文件
2.1.5.查看所有app的包名: 指令:adb shell pm list packages
2.1.6.系统应用: 指令:adb shell pm list packages –s
2.1.7.查看已安装的第三方软件: 指令:adb shell pm list packages -3 nter)
2.1.8将电脑文件传输到移动端: 指令:adb push 电脑路径 移动端路径
2.1.9将移动端文件传输到电脑: 指令:adb pull 移动端路径 电脑路径
2.2.0查看adb命令帮助信息: 指令:adb help
2.2.1截屏: 指令:adb shell screencap -p 截图文件路径 adb shell screencap -p sdcard/1.gpg
2.2.2登录设备shell: adb shell adb shell <command命令> 后面加<command命令>将是直接运行设备命令, 相当于执行远程命令
2.2.3查看手机CPU情况: 指令:adb shell dumpsys cpuinfo
2.2.4查看应用内存使用情况: 指令:adb shell dumpsys meminfo +包名:应用的内存使用情况 adb shell dumpsys meminfo com.baidu.searchbox
2.2.5显示磁盘使用信息: 指令:adb shell dumpsys diskstats
2.2.6清除应用缓存信息: adb shell pm clear [packagename] 指令:adb shell pm clear com.baidu.searchbox
2.2.6查看电池状态: 指令:adb shell dumpsys battery
2.2.7查看电池信息 指令:adb shell dumpsys batteryproperties 显示当前电池关键属性值(ac:直充,USB,无线、状态、健康指数、当前状态指数、电量等级、音量、暂时声音大小、当前声音大小):
3.0. adb logcat 查看手机日志
adb logcat 命令格式 : adb logcat [选项] [过滤项], 其中 选项 和 过滤项 在 中括号 [] 中, 说明这是可选的;
“>”输出 : “>” 后面跟着要输出的日志文件, 可以将 logcat 日志输出到文件中, 使用adb logcat > log 命令(adb logcat >C:\log\c.txt)
指定 logcat 的日志输出格式 :
– “-v”选项 : 使用adb logcat -v time 命令, 可以啥看日志的输出时间; 将手机日志输出到本地文件中 adb logcat -v time > C:/log/aa.txt
Android 的日志分为如下几个级别: V —— Verbose(最低,输出得最多) D —— Debug I —— Info W —— Warning E —— Error F —— Fatal S —— Silent(最高,啥也不输出) 按某级别过滤日志则会将该级别及以上的日志输出。 比如,命令:adb logcat *:W 将 Warning、Error、Fatal 和 Silent 日志输出 adb logcat *:E>E:/ceshi/888.txt 显示所有优先级大于等于“warning”的日志
发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/128513.html原文链接:https://javaforall.cn
边栏推荐
- Le transaction
- Kotlin是如何帮助你避免内存泄漏的?
- Interview must ask, focus! Tell me about the Android application startup process and its source code?
- The form select in antd is received before it is selected
- With 433 remote control UV lamp touch chip-dlt8sa20a-jericho
- Array, string de duplication
- Black cat takes you to learn EMMC Protocol Part 24: detailed explanation of EMMC bus test program (cmd19 & cmd14)
- [FPGA] joint simulation of vivado and Modelsim
- Automatic light sensing arm lamp touch chip-dlt8sa15b-jericho
- Shell基础概念和变量
猜你喜欢

How to improve deep learning performance?

为什么说Crypto游戏正在改变游戏产业?

Chinese translation of pointnet:deep learning on point sets for 3D classification and segmentation

Leetcode daily question (2196. create binary tree from descriptions)

How does kotlin help you avoid memory leaks?

Rust 从入门到精通01-简介
![[embedded C foundation] Part 6: super detailed explanation of common input and output functions](/img/eb/69264bc0d8e9349991b7b9e1b8ca22.png)
[embedded C foundation] Part 6: super detailed explanation of common input and output functions

I copied the bottom of the liquidated NFT, but was locked by opensea

Smart touch screen LCD bathroom mirror light touch chip-dlt8t02s-jericho
![[matlab] IIR filter](/img/60/8e666bff3d458cdd9367ca45112b92.png)
[matlab] IIR filter
随机推荐
Rust from introduction to mastery 01 introduction
Risk analysis of option trading
Bear market spread portfolio
Protobuf data exchange format
Redis - Basics
Chapter 6 提升
[embedded C foundation] Part 5: original code / inverse code / complement code
Le transaction
UV germicidal lamp chip dlt8p65sa Jericho
子线程更新UI全解
.net for subtraction, intersection and union of complex type sets
Brother bird talks about cloud native security best practices
How does the vditor renderer achieve server-side rendering (SSR)?
Resolve browser password echo
基于深度学习的超分辨率重建
Sub thread update UI full solution
SSH port forwarding (Tunneling Technology)
Machine learning Basics - integrated learning-13
Redis —— 基础篇
Huawei cloud Gao Hongxia: CBC microservice code Reconstruction & independent release practice