'My adb path is correct but my adb is failing to install the apk

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)



Solution 1:[1]

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

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Diego Torres Milano