node
用来封装节点信息以用于快速操作
const (Integer) x
x坐标
const (Integer) y
y坐标
const (Integer) w
宽度
const (Integer) h
高度
const (Integer) cx
中心点x坐标
const (Integer) cy
中心点y坐标
const (Boolean) clickable
是否可点击
const (Boolean) longClickable
是否可长按
const (Boolean) enabled
是否可用
const (Boolean) selected
是否选中
const (Boolean) scrollable
是否可滚动
const (Boolean) checkable
是否可勾选
const (Boolean) checked
是否勾选
const (int[]) region
区域
- 格式为[left, top, width, height]
const (Boolean) multiLine
是否多行
const (Integer) drawOrder
绘制顺序
const (String) desc
描述信息
const (String) tip
提示信息
- 仅Android 9.0+支持
const (String) id
资源id
const (String) pkg
包名
const (String) cls
类名
const (String) text
文本
const (Integer) windowId
窗口id
const (AccessibilityNodeInfo) node
安卓原生节点信息
getX()
获取x坐标
- 返回 : {int} x坐标
getY()
获取y坐标
- 返回 : {int} y坐标
getW()
获取宽度
- 返回 : {int} 宽度
getH()
获取高度
- 返回 : {int} 高度
getCx()
获取中心点x坐标
- 返回 : {int} 中心点x坐标
getCy()
获取中心点y坐标
- 返回 : {int} 中心点y坐标
getClickable()
获取是否可点击
- 返回 : {boolean} 是否可点击
getLongClickable()
获取是否可长按
- 返回 : {boolean} 是否可长按
getEnabled()
获取是否可用
- 返回 : {boolean} 是否可用
getSelected()
获取是否选中
- 返回 : {boolean} 是否选中
getScrollable()
获取是否可滚动
- 返回 : {boolean} 是否可滚动
getCheckable()
获取是否可勾选
- 返回 : {boolean} 是否可勾选
getChecked()
获取是否勾选
- 返回 : {boolean} 是否勾选
getRegion()
获取区域
- 返回 : {int[]} 区域
getMultiLine()
获取是否多行
- 返回 : {boolean} 是否多行
getDrawOrder()
获取绘制顺序
- 返回 : {int} 绘制顺序
getTip()
获取提示信息
- 返回 : {String} 提示信息
getDesc()
获取描述信息
- 返回 : {String} 描述信息
getId()
获取资源id
- 返回 : {String} 资源id
getPkg()
获取包名
- 返回 : {String} 包名
getCls()
获取类名
- 返回 : {String} 类名
getText()
获取文本
- 返回 : {String} 文本
getWindowId()
获取窗口id
- 返回 : {int} 窗口id
getNode()
获取安卓原生节点信息
- 返回 : {AccessibilityNodeInfo} 安卓原生节点信息
click()
点击
click(useAct)
点击
- 参数 : useAct {boolean} 是否使用act点击
click(px,py)
点击
- 参数 : px {int} x的偏移量
- 参数 : py {int} y的偏移量
press()
长按
press(dur)
长按
- 参数 : dur {int} 长按时间
press(px,py)
长按
- 参数 : px {int} x的偏移量
- 参数 : py {int} y的偏移量
press(px,py,dur)
长按
- 参数 : px {int} x的偏移量
- 参数 : py {int} y的偏移量
- 参数 : dur {int} 长按时间
press(useAct)
长按
- 参数 : useAct {boolean} 是否使用act长按
move(dir)
滑动
- 参数 : dir {string} 方向:up,down,left,right
move(x2,y2,dur)
滑动
- 参数 : x2 {int} 目标x坐标
- 参数 : y2 {int} 目标y坐标
- 参数 : dur {int} 滑动时间
move(x2,y2,dur,delay)
滑动
- 参数 : x2 {int} 目标x坐标
- 参数 : y2 {int} 目标y坐标
- 参数 : dur {int} 滑动时间
- 参数 : delay {int} 滑动延迟
move(px,py,x2,y2,dur,delay)
滑动
- 参数 : px {int} x的偏移量
- 参数 : py {int} y的偏移量
- 参数 : x2 {int} 目标x坐标
- 参数 : y2 {int} 目标y坐标
- 参数 : dur {int} 滑动时间
- 参数 : delay {int} 滑动延迟
draw()
全屏绘制节点方框 需要悬浮窗权限
input(text)
输入内容