Why does appium creates appium.tmp file?

Why does appium creates appium.tmp file? It throws an error while renaming it when run from Jenkins.

error: Failed to start an Appium session, err was: Error: EACCES, rename ‘/var/folders/w3/b1slyjnx4vs4cc868hbchmwc0000gq/T/1151024-89446-9ofuxx/appium.tmp’

How to resolve this?

On iOS, Appium creates temp files because instruments needs too. I’m not sure on Android, maybe adb needs a log output?

For resolution, could you use the ‘–tmp’ flag on the server to store the temp files someplace the Jenkins user has write access too? For example, their home directory: --tmp ‘/Users/Jenkins’, if that exists.

http://appium.io/slate/en/v1.2.0/?ruby#server-flags