解决Android 7.0系统的手机无法执行appium脚本的问题

1、 找到appium的安装目录下的adb.js文件,windows版本的目录如下:E:\Appium\node_modules\appium\node_modules\appium-adb\lib
2、 打开adb.js,手动修改该文件下的内容:
在1035行开始这段代码后面加上:outlines.shift();
 
ADB.prototype.getPIDsByName = function (name, cb) {
logger.debug("Getting all processes with '" + name + "'");
this.shell("ps '" + name + "'", function (err, stdout) {
if (err) return cb(err);
stdout = stdout.trim();
var procs = [];
var outlines = stdout.split("\n");
outlines.shift(); //在该处添加此行代码
3、重启appium
posted @ 2017-06-01 16:57  51QA  阅读(2908)  评论(0编辑  收藏  举报