我的 adb 路径是正确的,但我的 adb 无法安装 apk
我是 MacOS 用户,我正在尝试访问应用程序中的特定活动(该应用程序是 APK 文件)。我从 Android Studio 运行的模拟器是 Pixel 3a XL。我有一个连接到 Appium 服务器的 Python 客户端。我使用 Appium GUI 服务器来运行代码并使用 PyCharm 来编写代码。在运行 Appium GUI 服务器、Android 模拟器和 PyCharm 代码之前,我使用了不同的 APK 文件,然后切换到新的文件。我输入命令“appium-doctor --android”来验证我的环境变量和 adb 是否正确,并且有复选标记表明它是正确的。切换到更新的 APK 文件后,我收到一条错误,指出 adb 无法安装 APK。我还看到一条错误,指出“失败 [INSTALL_FAILED_INSUFFICIENT_STORAGE]”。以下是错误消息和代码。
以下是错误消息:
原始错误:执行 adbExec 时出错。原始错误:“命令”/Users/jkenglish/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 install /Users/jkenglish/Desktop/Surge_Projects/app-debug-signed-2-21- 22.apk' 退出,代码为 1'; Stderr: 'adb: 无法安装 /Users/jkenglish/Desktop/Surge_Projects/app-debug-signed-2-21-22.apk: 失败 [INSTALL_FAILED_INSUFFICIENT_STORAGE]';代码:'1'
代码:
从appium导入webdriver
所需的能力= { "设备名称": "Pixel_3a_XL", "appPackage": "edu.psu.hhd.hdfs.jpm165.genericsurveyapp2", "appActivity": ".SplashScreenActivity", “平台名称”:“Android”, “应用程序”:“/Users/jkenglish/Desktop/Surge_Projects/app-debug-signed-2-21-22.apk” }
#驱动程序实例
webdriver.Remote("http://localhost:4723/wd/hub",desired_capability)
I am a MacOS user, and I am trying to access a specific activity within an app (the app is the APK file). The emulator I am running from Android Studio is Pixel 3a XL. I have a Python client connected to the Appium server. I am using the Appium GUI server to run the code and using PyCharm to write the code. Prior to running the Appium GUI server, Android emulator, and PyCharm code, I was using a different APK file then switched to a new one. I typed in the command, 'appium-doctor --android' to verify that my environment variables and adb is correct and there were checkmarks indicating that it was. After switching to an updated APK file, I received an error stating that the adb failed to install the APK. I also see an error that states 'Failure [INSTALL_FAILED_INSUFFICIENT_STORAGE]'. Below are the error messages and code.
Here's the error messages:
Original error: Error executing adbExec. Original error: 'Command '/Users/jkenglish/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 install /Users/jkenglish/Desktop/Surge_Projects/app-debug-signed-2-21-22.apk' exited with code 1'; Stderr: 'adb: failed to install /Users/jkenglish/Desktop/Surge_Projects/app-debug-signed-2-21-22.apk: Failure [INSTALL_FAILED_INSUFFICIENT_STORAGE]'; Code: '1'
Code:
from appium import webdriver
desired_capabilities = {
"deviceName": "Pixel_3a_XL",
"appPackage": "edu.psu.hhd.hdfs.jpm165.genericsurveyapp2",
"appActivity": ".SplashScreenActivity",
"platformName": "Android",
"app":"/Users/jkenglish/Desktop/Surge_Projects/app-debug-signed-2-21-22.apk"
}
#Driver Instance
webdriver.Remote("http://localhost:4723/wd/hub", desired_capabilities)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以在模拟器上运行此命令来验证剩余空间
输出,例如
You can run this command on your emulator to verify the space left
outputs something like