我的 adb 路径是正确的,但我的 adb 无法安装 apk

发布于 2025-01-09 08:01:21 字数 1233 浏览 0 评论 0原文

我是 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

顾铮苏瑾 2025-01-16 08:01:21

您可以在模拟器上运行此命令来验证剩余空间

$ adb shell su root df -h /data/app

输出,例如

Filesystem      Size  Used Avail Use% Mounted on
/dev/block/dm-5   XG    xM    YG   p% /mnt/user/0/emulated/0/Android/obb

You can run this command on your emulator to verify the space left

$ adb shell su root df -h /data/app

outputs something like

Filesystem      Size  Used Avail Use% Mounted on
/dev/block/dm-5   XG    xM    YG   p% /mnt/user/0/emulated/0/Android/obb
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文