Appium eating up hard drive space by dumping multiple payloads and files

I’ve been having an issue lately where appium will create the same file folder over and over again with the app payload and I’m constantly stopping while I’m working to clear these out as it can take up 20GB of space in no time at all. I think it might be happening at the start of each new session.

This all goes in at private>var in it’s sub folders and I’m pretty sure there’s more space being taken up somewhere else. How do I fix this?

I have Appium running on a couple of Linux machines that run with the systemd init system. Appium writes the cached application archives to the system’s /tmp directory. I believe systemd has an internal framework that removes /tmp files and directories if they reach a certain age.

Alternatively, you could use Selenium Grid Extras and reboot the machine every few tests. Most Linux systems will clear out /tmp during reboot.