docs/setup/linux_setup.md
Get the CLI from npm:
npm install -g @snap/valdi. Then runvaldi dev_setupfor automated setup. This guide is a reference for manual installation or troubleshooting only.
This guide documents the dependencies Valdi needs on Linux and how to install them manually. For the quickest setup, use valdi dev_setup which automates all of these steps.
This guide assumes you're using the default shell (bash). Setup is possible for other shells, but you'll need to adapt the configuration file paths.
curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | sudo bash
On Debian/Ubuntu, install the same dependencies that valdi dev_setup would use:
apt-get install npm openjdk-17-jdk git-lfs watchman adb libfontconfig1-dev zlib1g-dev
(On other distros, use the equivalent packages: e.g. RHEL/Fedora use java-17-openjdk-devel, android-tools, fontconfig-devel, zlib-devel. The CLI detects your distro and installs the right packages.)
[!NOTE]
valdi dev_setupinstalls Bazelisk automatically. It downloads the bazelisk binary to~/.valdi/bin/and adds it to your PATH.
For manual installation, follow the Bazelisk installation guide or install via npm:
npm install -g @bazel/bazelisk
Git Large File Storage (LFS) manages the binaries that we need for Valdi.
git lfs install
[!NOTE]
valdi dev_setupinstalls Android SDK command-line tools automatically. You only need Android Studio if you prefer using its GUI or need Android emulator management.
Run valdi dev_setup - it will download and install Android SDK command-line tools, including:
If you prefer using Android Studio's GUI:
Tools -> SDK ManagerHide obsolete packages, check Show Package DetailsAdd the following to your .bashrc
echo "export ANDROID_HOME=$HOME/Android/Sdk" >> ~/.bashrc
echo "export ANDROID_NDK_HOME=\$ANDROID_HOME/ndk-bundle" >> ~/.bashrc
echo "export PATH=\$ANDROID_HOME/platform-tools:\$PATH" >> ~/.bashrc
source ~/.bashrc
Bazel eats a lot of memory, if you see Java memory errors, you don't have enough swap space.
8GB should be enough for an Android build of the hello world app.