当前位置:网站首页>App移动端测试【3】ADB命令
App移动端测试【3】ADB命令
2022-07-03 15:30:00 【Leo_Eagle】
Adb(android Debug Bridge),它允许真机与模拟器(或手机助手等)进行通信。这样大大提升了设备(真机)的操作便利.
1.ADB的认知
1.1 Adb的认知
Adb(android Debug Bridge),它允许真机与模拟器(或手机助手等)进行通信。这样大大提升了设备(真机)的操作便利
老师的,安卓sdk路径如:D:\Program Files (x86)\Android\android-sdk\platform-tools,在该目录下可以看到adb开头的3个文件,
验证adb是否配置完整。在Cmd中输入adb
Cmd
Adb
1.2 Adb的工作原理
启动adb客户端,客户端会与本地TCP端口(5037)绑定,然后开始侦听adb客户端发出的所有命令,然后使用端口5037与adb服务器通信。
1.3 启用adb调试
必须在手机上启动usb调试,才可以进行adb调试(如不知道如何打开手机的usb调试,请查看前面的文章:uiautomator
++App移动端测试【2】安卓模拟器部署++)。
1.4 Adb的基础命令
在cmd中执行如下
- 查看adb版本
C:\Users\Leo>adb version
- 查看设备信息
C:\Users\Leo>adb devices
List of devices attached
* daemon not running; starting now at tcp:5037
* daemon started successfully
GWY0217306003796 unauthorized
2. ADB的基础命令
2.1 Adb的基础命令
- 查看adb版本
C:\Users\Leo>adb version
- 查看设备信息
C:\Users\Leo>adb devices
List of devices attached
* daemon not running; starting now at tcp:5037
* daemon started successfully
GWY0217306003796 unauthorized
- 连接模拟器
C:\Users\Leo>adb connect 127.0.0.1:62001
注意事项:夜神模拟器的第1台模拟器的端口是62001,第2台是62025,第3台62025+1。
C:\Users\Leo>adb connect 127.0.0.1:62001
adb server version (36) doesn't match this client (40); killing...
原因:出现以上(adb server version (36) doesn’t ….)提示的原因,是因为android sdk中的adb版本与模拟器中adb版本不同造成的。
解决方案:
把android sdk下3个adb开头的文件(如下图),复制到模拟器下面,替换模拟器下(D:\Program Files\Nox\bin)对应的3个文件(如下图)。
- Adb shell
Adb shell
当有多台设备(模拟器链接pc的时候)
C:\Users\Leo>adb -s 127.0.0.1:62001 shell
[email protected]:/ #
格式 adb –s 需要的模拟器的ip与端口 shell
测试精讲视频
如果你觉的文章读的不过瘾,可以查看详细的视频教程。
学习路线如下
边栏推荐
- Subclass hides the function with the same name of the parent class
- 【日常训练】395. 至少有 K 个重复字符的最长子串
- 秒杀系统2-Redis解决分布式Session问题
- [cloud native training camp] module 7 kubernetes control plane component: scheduler and controller
- 驱动与应用程序通信
- How are integer and floating-point types stored in memory
- The difference between RAR and zip files
- Redis主从、哨兵、集群模式介绍
- Puppet automatic operation and maintenance troubleshooting cases
- Visual upper system design and development (Halcon WinForm) -1 Process node design
猜你喜欢
String functions that you need to know
"Seven weapons" in the "treasure chest" of machine learning: Zhou Zhihua leads the publication of the new book "machine learning theory guide"
整形和浮点型是如何在内存中的存储
高并发下之redis锁优化实战
The state does not change after the assignment of El switch
函数栈帧的创建和销毁
找映射关系
【云原生训练营】模块八 Kubernetes 生命周期管理和服务发现
Visual upper system design and development (Halcon WinForm) -5 camera
《微服务设计》读书笔记(下)
随机推荐
The state does not change after the assignment of El switch
CString getbuffer and releasebuffer instructions
Popular understanding of gradient descent
do{}while()的妙用
The wonderful use of do{}while()
Tensorflow realizes verification code recognition (II)
Win32 create window and button (lightweight)
Detailed pointer advanced 2
Idea does not specify an output path for the module
Problems of CString in multithreading
Summary of JVM knowledge points
C语言刷题~Leetcode与牛客网简单题
Enable multi-threaded download of chrome and edge browsers
qt使用QZxing生成二维码
Kubernetes - yaml file interpretation
Visual upper system design and development (Halcon WinForm) -4 Communication management
Custom annotation
Matlab r2011b neural network toolbox precautions
Using notepad++ to build an arbitrary language development environment
GCC cannot find the library file after specifying the link library path