 | |  |  | iosApp管理小结和苹果Ocr识别结果小结
- // 方法一:openApp启动
- app.openApp('')
- //方法二: appopenSelf自启动
- app.openSelf()
- // 方法三:runShortcut运行快捷指令
- app.runShortcut('')
- //方法四: openWebPage打开网页
- app.openWebPage('')
- //方法五: getMemory获取app内存占用
- app.getMemory()
复制代码- // getAllString 获取所有识别的文本方法小结,交流QQ群711841924
- // 方法一:getAllString 获取所有识别的文本
- var ocrResult = screen.ocr(0,0,1,1);
- var allText = ocrResult.getAllString();
- // 方法二:getAllDetect 获取所有识别的目标
- var ocrResult = screen.ocr(0,0,1,1);
- var detects = ocrResult.getAllDetect(); // 获取所有识别的目标
- // 方法三:findText查找特定文本
- var ocrResult = screen.ocr(0,0,1,1);
- var foundDetect = ocrResult.findText("特定文本",[0, 0, 1, 1]);
- // 方法四:findIncludeText查找包含特定文本单目标
- var ocrResult = screen.ocr(0,0,1,1)
- var detect = ocrResult.findIncludeText("包含文本",[0, 0, 1, 1]);
- // 方法五:findIncludeTexts查找包含特定文本多个目标
- var ocrResult = screen.ocr(0,0,1,1);
- var detects = ocrResult.findIncludeTexts("特定文本",[0, 0, 1, 1]);
- // 方法六:findTextWithRegex 正则查找包含特定多个目标
- var detect=(ocrres.findTextWithRegex("领.*? 钻石",[0, 0, 1, 1]));
- if(detect == null){
- printl("未找到");
- }else{
- printl(detect[0]);
- detect[0].clickRandom();
- }
- // 方法七:getJSON 获取结果的JSON字符串
- var ocrResult = screen.ocr(0,0,1,1);
- var json = ocrResult.getJSONO;//获取JSON字符串
复制代码
| |  | |  |
|