appium 安装 uiautomator2-server-debug-androidTest.apk 、appium-uiautomator2-server-v5.12.16.apk 失败的解决办法

简介: appium 安装 uiautomator2-server-debug-androidTest.apk 、appium-uiautomator2-server-v5.12.16.apk 失败的解决办法

一、前置说明


UnknownError: An unknown server-side error occurred while processing the command. Original error: Error executing adbExec. Original error: ‘Command ‘D:\ProgramFiles\Android\android-sdk\platform-tools\adb.exe -P 5037 -s 9YS0220306003185 install -r C:\Users\xyouw\.appium\node_modules\appium-uiautomator2-driver\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-debug-androidTest.apk’ timed out after 20000ms’. Try to increase the 20000ms adb execution timeout represented by ‘uiautomator2ServerInstallTimeout’ capability


二、操作步骤


先在capabilities中设置 uiautomator2ServerInstallTimeout 的时间,再尝试运行:

capabilities = {
        "platformName": "Android",
        "automationName": "uiautomator2",
        "deviceName": "127.0.0.1:62001",
        "app": "D:\\resources\\ApiDemos-debug.apk",
        "uiautomator2ServerInstallTimeout": 60000,  # 添加这一行
    }


如果仍然安装不成功,可以手动进行安装。在日志中找到 apk 的位置,以我的日志为例:C:\\Users\\xyouw\\.appium\\node_modules\\appium-uiautomator2-driver\\node_modules\\appium-uiautomator2-server\\apks\\appium-uiautomator2-server-debug-androidTest.apk,将这段日志复制出来并转换成:C:\Users\xyouw\.appium\node_modules\appium-uiautomator2-driver\node_modules\appium-uiautomator2-server\apks\ ,然后在资源文件管理器中打开:


右键,在终端中打开,执行 adb install 命令,手动安装这两个包即可:


 adb install .\appium-uiautomator2-server-debug-androidTest.apk
 adb install .\appium-uiautomator2-server-v5.12.16.apk 
目录
相关文章
|
1天前
|
Java 程序员 Android开发
apk简单介绍(组成以及打包安装流程)
apk简单介绍(组成以及打包安装流程)
45 0
|
20小时前
|
XML API Android开发
android S 上 安装apk出现android.os.FileUriExposedException
android S 上 安装apk出现android.os.FileUriExposedException
15 6
|
1天前
|
Java 定位技术 Android开发
安装apk显示 requires unavailable shared library com.xxx
安装apk显示 requires unavailable shared library com.xxx
12 0
|
1天前
|
缓存 Android开发 开发者
pc上使用命令给android安装apk
pc上使用命令给android安装apk
20 0
|
1天前
|
Java Android开发
Android Mediatek 添加 APK 安装和下载开关
Android Mediatek 添加 APK 安装和下载开关
8 0
|
9月前
|
Android开发
Android PackageManagerService源码分析和APK安装原理详解
Android PackageManagerService源码分析和APK安装原理详解
220 1
|
12月前
【APK.1安装器】实用的手机软件安装补丁
【APK.1安装器】实用的手机软件安装补丁
|
Shell 测试技术 Android开发
Python Python实现批量安装android apk包
Python Python实现批量安装android apk包
322 0
|
Android开发
AS打包APK时,一直缺失so库的解决办法
AS打包APK时,一直缺失so库的解决办法
147 0
|
1天前
|
Android开发 开发者
Android Split APK介绍
【2月更文挑战第5天】