Problem to solve: Appium run times error Failure on androidV7.0 system [install_failed_already_exists:attempt to re-install Io.appium.settings Without first uninstalling.]
Cause Analysis: The uiautomator version of Appium is not suitable for androidV7.0.
Pre-set conditions: Mobile phone end has been installed Appium Settings and unlock two applications
Resolution steps: 1. Modify the source file-note two lines of code to install Appiumsettings and unlock
File path: C:\Program files (x86) \appium\node_modules\appium\lib\devices\android\android.js
2. Modify the source file as follows:
A. Open \program Files (x86) \appium\node_modules\appium\node_modules\appium-adb\lib\adb.js
B. Found in line 1035 of Adb.js
this.shell(
"ps ‘"
+
name
+
"‘"
, function (err, stdout) {
if
(err)
return
cb(err);
替换成
this.shell_grep(
"ps"
, name, function (err, stdout) {
if
(err) {
logger.debug(
"No matching processes found"
);
return
cb(null, []);
}
并增加上面用到的shell_grep函数:
ADB.prototype.shell_grep
=
function (cmd, grep, cb) {
if
(cmd.indexOf(
‘"‘) === -1) {
cmd = ‘"‘
+
cmd
+
‘"‘
;
}
var execCmd
=
‘shell ‘
+
cmd
+
‘| grep ‘
+
grep;
this.
exec
(execCmd, cb);
};
3. Restart Appium
"Pro-Test" appium_v1.4.16 version Automation adaptation android7.0 system