Android emulator temp directories

If you are using the Android SDK on a shared computer, you might run into the awesome “NAND: could not create temp file for system NAND” error. This is because “/tmp/android” is hardcoded into the emulator as the directory to start temporary files during emulation, and somebody else has likely claimed it first.

The easiest workaround is, if it won’t cause any problems, to delete or chown the /tmp/android directory, preventing anybody else from using it. If you must share, then you can set up the group so that multiple devs can access it.

But the best way, if you’re not the sysadmin, is to change the temp directory for yourself. You can modify the emulator and change the hardcoded values.

Run “vim -b tools/emulator” and search for “tmp/android” (which would be “/tmp\/android” in vim-speak). Overwrite the name android to something that doesn’t already exist, like “/tmp/anderic”, being careful not to change the length of the file.

Restart your emulator.

2 Responses to “Android emulator temp directories”

  1. amrita writes:

    i was doing from ADT and got the NAND error every time i tried..i got few suggetion like make space to /tmp but nothing worked and emulator dint run…please give me some proper suggesion

  2. tokland writes:

    You can use (at least in modern versions of the executable) the environement variable ANDROID_TMP. ANDROID_TMP=/path/to/tmp emulator …

Leave a Reply