appium===报错Failure [INSTALL_FAILED_ALREADY_EXISTS: Attempt to re-install io.appium.settings without first uninstalling.的解决办法

要解决的问题:appium在androidV7.0系统上运行时报错 Failure [INSTALL_FAILED_ALREADY_EXISTS: Attempt to re-install io.appium.settings without first uninstalling.]

原因分析:appium的uiautomator版本与androidV7.0不适配。

预置条件:手机端已经安装完Appium Settings 和 Unlock两个应用

解决步骤:1.修改源码文件-注释安装appiumSettings和unlock的两行代码

文件路径: C:\Program Files (x86)\Appium\node_modules\appium\lib\devices\android\android.js

2.修改源码文件如下:

a.打开  \Program Files (x86)\Appium\node_modules\appium\node_modules\appium-adb\lib\adb.js

b.在adb.js的1035行找到

     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.重启appium

时间: 2024-08-08 13:57:27

appium===报错Failure [INSTALL_FAILED_ALREADY_EXISTS: Attempt to re-install io.appium.settings without first uninstalling.的解决办法的相关文章

关于子线程使用Toast报错Can't create handler inside thread that has not called Looper.prepare()的解决办法

形同如下代码,在Thread中调用Toast显示错误信息: new Thread(new Runnable(){ @Override public void run() { try{ weatherData = getWeatherData(strUrl); parseJson(weatherData); }catch(Exception e){ Toast.makeText(WindowApplication.getAppContext(), e.toString(), Toast.LENGT

windows下编译caffe报错:error MSB4062: 未能从程序集 E:\NugetPackages\OpenCV.2.4.10\......的解决办法

参考博客:http://blog.csdn.net/u013277656/article/details/75040459 在windows上编译caffe时,用vs打开后会自动加载还原NugetPackages文件夹,里面是caffe需要依赖的各种库. 费了很长时间还原完成编译时,出现错误:error MSB4062: 未能从程序集 E:\NugetPackages\OpenCV.2.4.10\build\native\private\coapp.NuGetNativeMSBuildTasks

python+appium 【已解决】真机运行appium报错“WebDriverException: Message: A new session could not be created. (Original error: Command failed: C:\Windows\system32\cmd.exe /s /c.......详见内文

问题报错提示: selenium.common.exceptions.WebDriverException: Message: A new session could not be created. (Original error: Command failed: C:\Windows\system32\cmd.exe /s /c "D:\AutoTest\adt-bundle-windows-x86-20140702\sdk\platform-tools\adb.exe -s GWY0216A

【已解决】mac上appium报错:“Could not find aapt Please set the ANDROID_HOME environment variable with the Android SDK root directory path”

按照网上教程配置完appium环境后,真机跑自动化过程,遇到如下报错: appium报错如下: [ADB] Checking whether aapt is present [ADB] The ANDROID_HOME environment variable is not set to the Android SDK root directory path. ANDROID_HOME is required for compatibility with SDK 23+. Checking al

解决Appium报错cannot import name 'InvalidArgumentException'

好久没动代码,今天运行自动化脚本时突然报错 cannot import name 'InvalidArgumentException', 在CMD的python命令行下运行了下: from appium import webdriver   结果报上述错误,可见是引用错误. 百度了下,已解决. https://www.cnblogs.com/xingkeke/p/9692145.html,感谢博主分享 在python的安装目录中找到 exceptions.py 文件, 如我的目录是 D:\py\

<<< Tomcat运行报错IOException while loading persisted sessions: java.io.EOFException

解决方法:将work下面的文件清空,主要是*.ser文件,或者只是删除掉session.ser即可以解决. ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Putty使用公钥认证时,报错:Disconnected: No supported authentication methods available(server sent:public key) 问题的解决

Putty使用公钥认证时,按照常规方法设置,一直报错:Disconnected: No supported authentication methods available (server sent:public key). 如截图: 找了半天没找到问题出在哪里,sshd的设置一切正常.这个做过多次居然也能错???? 最后发现原来是 ~/.ssh/authorized_keys 文件的内容有问题,putty生成的pub文件的格式如下: ---- BEGIN SSH2 PUBLIC KEY ---

Vue报错:Uncaught TypeError: Cannot assign to read only property 'exports' of object 的解决方法

问题是这样的:如下>> 解决办法: 1“:我的webpack 最高版本,造成 混用import和module.exports :所以降低webpack版本 安装指定版本:npm install [email protected] -g 例如:npm install [email protected] -g 删除 编译目录文件: 2重新生成 然后输入启动命令: 成功解决!效果: 方法二: 注释掉后一个 重新生成,启动项目 OK! Vue报错:Uncaught TypeError: Cannot

pom.xm首行报错Failure to transfer org.codehaus.plexus:plexus-components:pom:1.1.20

从SVN导出一个Maven项目,pom.xml首行报错: Failure to transfer org.codehaus.plexus:plexus-components:pom:1.1.20 from http://maven.oschina.net/content/groups/public/ was cached in the local repository, resolution will not be reattempted until the update interval of