报错 selenium.common.exceptions.SessionNotCreatedException: Message: A new session could not be created. (Original error: Could not extract PIDs from ps output. PIDS: [], Procs: ["ps: uiautomator"])
解决方法:
打开appium安装目录,进入..Appium ode_modulesappium ode_modulesappium-adblib,打开adb.js
添加了如下一行,再次打开appium启动android 9 就可成功了
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("
");
outlines.shift();//添加了此行
_.each(outlines, function (outline) {
if (outline.indexOf(name) !== -1) {
procs.push(outline);
}
});
if (procs.length < 1) {
logger.debug("No matching processes found");
return cb(null, []);
}