Skip to content

Instantly share code, notes, and snippets.

@masemoel
Created January 25, 2022 22:41
Show Gist options
  • Save masemoel/537301229c1bd4c8b20c50f535751d19 to your computer and use it in GitHub Desktop.
Save masemoel/537301229c1bd4c8b20c50f535751d19 to your computer and use it in GitHub Desktop.
Enable ccache on Android 12 environments
# First time building A12
Open terminal and run:
sudo bash
mkdir /mnt/ccache
exit
sudo mount --bind /home/masemoel/.ccache /mnt/ccache
export USE_CCACHE=1 && export CCACHE_EXEC=/usr/bin/ccache && ccache -M 60G && export CCACHE_DIR=/mnt/ccache
(set ccache -M with the maximum of GB of your disk you wanna set available for ccache, and home/masemoel with home/ and your username on your Linux environment).
# Future builds
Just run on terminal, before starting the build
sudo mount --bind /home/username/.ccache /mnt/ccache
export USE_CCACHE=1 && export CCACHE_EXEC=/usr/bin/ccache && ccache -M xG && export CCACHE_DIR=/mnt/ccache
The mount command doesn't persist a reboot. The export commands should be run each time you open a new terminal window.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment