Macaca android 端,每次安装都需要安装 unlock、ime 2 个 apk,影响到测试

· 2017年02月17日 · 最后由 达峰的夏天 回复于 2017年02月25日 · 1449 次阅读

每次执行测试时都会安装 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}`);
};

共收到 5 条回复 时间 点赞

https://github.com/alibaba/macaca/issues/437
已经提过这个问题了,你可以暂时注释这两行安装的命令,临时解决。

yield this.adb.install(UnlockApk.apkPath);
yield this.adb.install(UnicodeInput.apkPath);

http://www.tarenacn.com/rjcsxy/iv0ed0y1.html 这个常用于处理 测试过程中某些意料之外的或者不知道什么时候弹出来的框而阻碍测试的正常进行。

这个你看一下,不知道 @xdf macaca 有没有处理这种弹框的方法

adb shell settings put global package_verifier_enable 0
adb shell settings put global verifier_verify_adb_installs 0

@2kb 已解决 欢迎更新试用

需要 登录 後方可回應,如果你還沒有帳號按這裡 注册