API 索引
本页用于帮助第三方开发者快速定位常见方法所属模块。详细参数、返回值和示例请跳转到对应模块页查看。
app
getDeviceInfo()getDeviceInfoSys()getRam()toast(msg, t)openPm()runApp(packageName)backToSelf()showTaskBar(show)showIcon(show)registerRouteApp(app, fun)registerRouteSys(app, fun)
auth
openAccessibilityService(open)openSysSetting(open)openPower(open)openFloatWindow(open)openMustPermissions(open)openAllFile(open)openScreenCap(open)
acc
getWindows()getNode(windowId?)getChildNode(index, nodeId)getParentNode(nodeId)performAction(nodeId, code)performActionEx(nodeId, code)findView(condition, timeout?)findViewEx(condition, timeout?)findViews(condition, timeout?)findViewByDesc(desc, timeout?)findViewByDescs(desc, timeout?)findViewById(id, timeout?)findViewByIds(id, timeout?)swipe(x1, y1, x2, y2, t)node.toJson(showOnlyVisible?)node.click()
file
createDir(dirPath)createFile(filePath)writeStr(filePath, textContent, append)writeBase64(filePath, base64Content)readStr(filePath)readFileToBase64(filePath)getFileInfo(filePath)getDirInfo(dirPath)copyFile(src, dest)rename(src, dest)delFile(filePath)delDir(dirPath)downloadFile(fileURL, savePath)asyncDownloadFile(fileURL, savePath, headers?, cookies?)DownloadFileWithProgress(fileURL, savePath, headers?, cookies?)getDownloadTaskStatus(downloadId)cancelDownloadTask(downloadId)
input
inputStr(str)setKeyCode(keyCode)setKeyDown(keyCode)setKeyUp(keyCode)setKeyChar(keyChar)setClipboardContent(text)getClipboardContent()setShellClipboardContent(text)getShellClipboardContent()paste()copy()cut()selectAllText()unSelectAllText()getSelectedText()moveCursorToStart()moveCursorToEnd()moveCursor(step)
shell
executeCommand(shell)executeCommandBackground(shell)
openCv
android.openCv是插件能力,需要先通过android.app.loadPlugin(...)加载opencv-plugin.zip后才能使用。插件 zip 通过android.file.writeBase64()推送到设备。
screenshot(x?, y?, w?, h?)loadImage(base64)save(imageId)list()release(imageId)releaseAll()getColor(imageId, x, y)cvtColor(imageId)binaryThreshold(imageId, threshold?)drawImg(imageId, x, y, w, h)delBackground(imageId, colors, qua)swapColor(imageId, colorA, colorB)findImg(imageId, smallImageId, qua)findColors(imageId, colors, qua)getBase64(imageId)
工具类 android.openCvUtil:
findImgByName(smallImgName, x1?, y1?, x2?, y2?, qua?)clickImgByName(smallImgName, x1?, y1?, x2?, y2?, qua?)
ocr
android.ocr和android.paddleOcr都是插件能力,需要先通过android.app.loadPlugin(...)加载对应插件包后才能使用。插件 zip 通过android.file.writeBase64()推送到设备。
android.ocr
ocr(qua?)ocrArea(qua, x1, y1, x2, y2)ocrBase64(imageBase64, qua)
android.paddleOcr
ocr(qua, x1?, y1?, x2?, y2?)ocrBase64(qua, imageBase64)switchLang(lang)currentLang()listLangs()addLang(lang, path)removeLang(lang)
其他模块
以下能力已并入当前主线文档,不再单独保留旧 doc/ts 遗留页面:
- 生命周期与连接事件:见 快速接入
- 节点服务 / 节点对象:见 Acc 模块
- 权限管理:见 Auth 模块
- 文件管理:见 File 模块
- 输入法 / 键代码:见 Input 模块
- 通用方法:见 App 模块 与 Shell 模块
- OCR / 截图 / 投屏:见 OCR 模块、OpenCV 模块 与 扩展能力
- 悬浮窗 / 短信 / 通讯录 / 触摸:见 扩展能力
保留的高频方法索引:
floatW.start()/floatW.setShow(show)/floatW.addLog(text)sms.readSms(offset, size)accContacts.readContacts(offset, size)h264.start(width, fps, bitrate)/h264.stop()touch.swipe(x1, y1, x2, y2, duration)
