Simulator connection port summary and common ADB commands

I. Introduction

If you perform automated testing, we can choose an emulator without a real machine. There are many emulators on the market at present, they adball have different default ports when they use the connection. When the adbemulator cannot be automatically connected, use the ip+端口connection manually .

Two, the simulator connection port summary

Emulator adb connection code Simulated organ network
NetEase Mumu adb connect 127.0.0.1:7555 http://mumu.163.com/
Night god adb connect 127.0.0.1:62001 https://www.yeshen.com/
Happy adb connect 127.0.0.1:21503 https://www.xyaz.cn/
Tencent Mobile Games Assistant adb connect 127.0.0.1:5555 https://syzs.qq.com/sempage/mrzh/index.html
day by day adb connect 127.0.0.1:6555 http://www.ttmnq.com/
Seahorse playing adb connect 127.0.0.1:26744 http://www.haimawan.com/
BlueStacks adb connect 127.0.0.1:5555 https://www.bluestacks.cn/
Thunder and lightning adb connect 127.0.0.1:5555 http://www.ldmnq.com/ldy/baidu.html
Genymotion adb connect 127.0.0.1:5555 https://www.genymotion.com/
iTools adb connect 127.0.0.1:54001 http://www.itools.cn/

Three, ADB commonly used commands

1 Connect command

adb.exe connect 127.0.0.1:21503

2 Check the device connection

adb.exe devices
adb kill-server
adb start-server
adb remount

3 Transfer files or folders on the computer to the simulator

adb push D:/1.avi /mnt/avi/

4 Transfer files or folders in the simulator to the computer

adb pull /mnt/avi/sex.avi D:/avi/

5 Install APK

adb install d:\\qq.apk

6 Uninstall APK

adb uninstall 包名

For example, uninstall QQ:

adb uninstall com.tencent.mobileqq

7 Get all package names of the simulator

adb shell pm list packages

8 Get all package names of the simulator and include the APK path

adb shell pm list packages -f

9 Get the APK path corresponding to the package name

adb shell pm path packageName

10 Clean up application data

adb shell pm clear packageName

11 Start the application

adb shell am start -n 包名/Activity类名

Example: Start the application treasure:

adb shell am start -n com.tencent.android.qqdownloader/com.tencent.assistant.activity.SplashActivity

Specify the simulator to start the mobile application treasure:

adb -s 127.0.0.1:5555 shell am start -n com.tencent.android.qqdownloader/com.tencent.assistant.activity.SplashActivity

12 Close the app

adb shell am force-stop 包名

13 analog input

adb shell input text 字符串(不支持中文)

14 Simulation button

adb shell input keyevent 键值

15 Simulate mouse click

adb shell input tap X Y

16 Simulate mouse sliding

adb shell input swipe X1 Y1 X2 Y2

17 Screenshot

adb shell screencap -p /sdcard/screencap.png

18 Get the port number

This command is not adba command, but it is also very commonly used

netstat |findstr 127.0.0.1

Guess you like

Origin blog.csdn.net/linxinfa/article/details/107854134