Added getTexts and action recorder, fixed github issue report token

This commit is contained in:
hyb1996
2017-02-15 18:10:17 +08:00
parent 04b4303899
commit e2d5efa710
82 changed files with 1392 additions and 518 deletions

View File

@@ -25,6 +25,18 @@
* `notStopped` 若当前脚本处于运行状态时返回`true`, 否则返回`false`。对于某些循环, 例如`while(true)`,请用`while(notStopped())`代替,以免死循环造成的脚本无法正常停止。
* `isStoppd` 若当前脚本处于停止状态时返回`true`, 否则返回`false`
* `shell(cmd, root=false)` 执行shell命令cmd, 其中参数root表示是否以root权限执行默认为false。例如`shell("input keyevent 26", true); //锁屏`
* `getTexts()` 获取屏幕上的文字列表, 返回一个java.util.List<String>。例如:
```
launchApp("微信");
while(!click("通讯录"));
var texts = getTexts();
for(var i = 0; i < texts.size(); i++){
log(texts.get(i));
}
openConsole();
```
###四、全局变量
* `context` ApplicationContext参见安卓[android.content.Context](https://developer.android.com/reference/android/content/Context.html)
> 这里的context由于是ApplicationContext是不可见的不能用于dialog和其他UI相关。如果要显示弹窗或者视图请启动UI模式代码的第一行为`"ui";`既可并使用activity代替。