移动APP测试,adb工具,APP的操作

1.获取点击坐标

  1. 进入shell模式
adb shell
  1. 进入手机监听事件
getevent

在这里插入图片描述
3. 获取坐标
在需要获取的坐标位置,单击。
在这里插入图片描述
出现上图,即为获取成功。Ctrl+C停止。

003 0035   X坐标:  0000009a  
003 0036   Y坐标:  000004a1

在这里插入图片描述
4. 坐标16进制转10进制
打开win自带的计算器,选择程序员模式。
在这里插入图片描述

BIN:二进制(1111)
OCT:八进制(17)
DEC:十进制(15)
HEX:十六进制(F)

分别输入十六进制的坐标:
0000009a
000004a1
在这里插入图片描述
分别得到
154
1185
即为点击X,Y坐标。

注:请检查是否开启“开发者模式”以及root,在“开发者选项”中,找到“点按操作反馈”和“指针位置”并勾选上
在这里插入图片描述

2.根据坐标点击

#adb shell input tap x y
adb shell input tap 154 1185

在这里插入图片描述

3.在控件中输入信息

#adb shell input text  内容
adb shell input 123456

4.模拟手机按键

#adb shell input keyevent 编号
#详尽编号 需要自行查询 Android KeyCode 列表
adb shell input keyevent 3    // Home
adb shell input keyevent 4    // Back
adb shell input keyevent 19  //Up
adb shell input keyevent 20  //Down
adb shell input keyevent 21  //Left
adb shell input keyevent 22  //Right
adb shell input keyevent 23  //Select/Ok
adb shell input keyevent 24  //Volume+
adb shell input keyevent 25  // Volume-
adb shell input keyevent 82  // Menu 菜单
adb shell input keyevent --longpress 3 //长按 home键

5.滑动屏幕

adb shell input swipe x1 y1 x2 y2 // 手机滑动屏幕
x1 y1 开始坐标
x2 y2 结束坐标
adb shell input touchscreen swipe x1 y1 x2 y2 //上下滑动
adb shell input touchscreen swipe x1 y1 x2 y2 //左右滑动 

6.拨打电话,发送短信

#拨打电话,模拟器不支持
adb shell am start -a android.intent.action.CALL tel:电话号码
#发送短信,模拟器不支持
adb shell am start -a android.intent.action.SENDTO -d sms:10086(发送目的号码) --es sms_body "hello"(短信内容) --ez exit_on_sent true

7.打开网页

adb shell am start -a android.intent.action.VIEW -d http://www.baidu.com

在这里插入图片描述

8.调试模式

# 获取调试模式
shell settings get global adb_enabled
# 取消调试模式
adb shell settings put global adb_enabled 0
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

xuanccx

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值