每次执行测试时都会安装 unlock、ime
vivo、oppo、小米、锤子等机型在安装这 2 个 app 时会弹窗确认安装的窗口
此时测试无法进行下去。

如锤子 SM701 弹窗后,若不处理该窗口就不会继续。

Android.prototype.unlock = function *() {
  if (!_.isExistedFile(UnlockApk.apkPath)) {
    logger.warn(`unlock apk not found in: ${UnlockApk.apkPath}`);
    return;
  }
  yield this.adb.install(UnlockApk.apkPath);
  var isScreenLocked = yield this.adb.isScreenLocked();

  if (isScreenLocked) {
    yield this.adb.startApp(UnlockApk);
    yield _.sleep(5000);
    yield this.unlock();
  }
};
Android.prototype.setIME = function *() {
  yield this.adb.install(UnicodeInput.apkPath);
  yield this.adb.setIME(`${UnicodeInput.package}/${UnicodeInput.activity}`);
};


↙↙↙阅读原文可查看相关链接,并与作者交流