### Install Platform Tools Source: https://grapheneos.org/build Install and add platform-tools to the system PATH. ```bash sdkmanager platform-tools ``` ```bash export PATH="$HOME/android/sdk/platform-tools:$PATH" ``` -------------------------------- ### Install NDK Source: https://grapheneos.org/build Install and add NDK to the system PATH. ```bash sdkmanager 'ndk;29.0.14206865' ``` ```bash export PATH="$HOME/android/sdk/ndk/27.2.12479018:$PATH" ``` -------------------------------- ### Install Minimal SDK Source: https://grapheneos.org/build Commands to bootstrap a minimal Android SDK installation at ~/android/sdk. ```bash mkdir -p ~/android/sdk/bootstrap cd ~/android/sdk/bootstrap curl -O https://dl.google.com/android/repository/commandlinetools-linux-11076708_latest.zip echo '2d2d50857e4eb553af5a6dc3ad507a17adf43d115264b1afc116f95c92e5e258 commandlinetools-linux-11076708_latest.zip' | sha256sum -c unzip commandlinetools-linux-11076708_latest.zip cmdline-tools/bin/sdkmanager 'cmdline-tools;latest' --sdk_root=$HOME/android/sdk cd .. rm -r bootstrap ``` -------------------------------- ### Install Build Tools Source: https://grapheneos.org/build Install and add build-tools to the system PATH. ```bash sdkmanager 'build-tools;36.0.0' ``` ```bash export PATH="$HOME/android/sdk/build-tools/36.0.0:$PATH" ``` -------------------------------- ### Install Android Studio Source: https://grapheneos.org/build Installs Android Studio and ensures it's detected via the ANDROID_HOME environment variable. This method avoids installing a separate copy of the SDK. ```shell cd ~/ android curl -O https://dl.google.com/dl/android/studio/ide-zips/2025.3.2.6/android-studio-panda2-linux.tar.gz echo '32942d8cd7688192cf3cd07bf282fb120035b9bd9b56e6f13c5540e6d39807e9 android-studio-panda2-linux.tar.gz' | sha256sum -c tar xvf android-studio-panda2-linux.tar.gz rm android-studio-panda2-linux.tar.gz mv android-studio studio ``` -------------------------------- ### Check Fastboot Version Output Example Source: https://grapheneos.org/install/cli Example output of 'fastboot --version' after successfully setting up standalone platform-tools. Verifies the tool is accessible and reports its version. ```text fastboot version 35.0.2-12147458 Installed as /home/username/platform-tools/fastboot ``` -------------------------------- ### Download and Verify Platform-Tools on Debian/Ubuntu Source: https://grapheneos.org/install/cli Installs necessary tools, downloads the standalone platform-tools, verifies its integrity using SHA256, and extracts it. Ensure you have libarchive-tools installed. ```bash sudo apt install libarchive-tools curl -O https://dl.google.com/android/repository/platform-tools_r35.0.2-linux.zip echo 'acfdcccb123a8718c46c46c059b2f621140194e5ec1ac9d81715be3d6ab6cd0a platform-tools_r35.0.2-linux.zip' | sha256sum -c bsdtar xvf platform-tools_r35.0.2-linux.zip ``` -------------------------------- ### Install OpenSSH Source: https://grapheneos.org/install/cli Commands to install the OpenSSH client on various Linux distributions. ```bash sudo pacman -S openssh ``` ```bash sudo apt install openssh-client ``` -------------------------------- ### Flash Factory Images Source: https://grapheneos.org/install/cli Execute the flashing script to install the OS and firmware. ```linux/macos bash flash-all.sh ``` ```windows ./flash-all.bat ``` -------------------------------- ### Install Android Tools on Arch Linux Source: https://grapheneos.org/install/cli On Arch Linux, install the 'android-tools' package which includes fastboot. This is an alternative to using the standalone platform-tools. ```bash sudo pacman -S android-tools ``` -------------------------------- ### Set Up Build Environment Source: https://grapheneos.org/build Initializes the build environment variables. Must be run in bash or zsh. ```bash source build/envsetup.sh ``` -------------------------------- ### Install Build Dependencies on Debian Source: https://grapheneos.org/build Installs essential packages required for building GrapheneOS on Debian systems. ```bash apt install repo yarnpkg zip rsync ``` -------------------------------- ### Initialize GrapheneOS Source Tree Source: https://grapheneos.org/build Creates a directory for the source and initializes the repository with a specific tag. ```bash mkdir grapheneos-TAG_NAME cd grapheneos-TAG_NAME repo init -u https://github.com/GrapheneOS/platform_manifest.git -b refs/tags/TAG_NAME ``` -------------------------------- ### Install Adevtool Dependencies Source: https://grapheneos.org/build Installs required dependencies for the vendor extraction tool. Use yarnpkg on Debian systems. ```bash yarn --cwd vendor/adevtool/ install ``` -------------------------------- ### Initialize GrapheneOS Repository Source: https://grapheneos.org/build Initializes the GrapheneOS build environment by cloning the platform manifest for the `16-qpr2` development branch. ```bash mkdir grapheneos-16-qpr2 cd grapheneos-16-qpr2 repo init -u https://github.com/GrapheneOS/platform_manifest.git -b 16-qpr2 ``` -------------------------------- ### Build Components Source: https://grapheneos.org/build Compiles the WebView, browser, and configuration APKs using autoninja. ```bash chrt -b 0 autoninja -C out/Default/ trichrome_webview_64_32_apk trichrome_chrome_64_32_apk trichrome_library_64_32_apk vanadium_config_apk ``` -------------------------------- ### Install udev Rules on Arch Linux Source: https://grapheneos.org/install/cli Installs the 'android-udev' package on Arch Linux to allow non-root access to USB devices, which is necessary for fastboot operations. ```bash sudo pacman -S android-udev ``` -------------------------------- ### Configure Build Arguments Source: https://grapheneos.org/build Opens the GN configuration editor to set build parameters. ```bash gn args out/Default ``` -------------------------------- ### Sync kernel sources Source: https://grapheneos.org/build Initialize and sync the kernel source repository for the emulator. ```bash mkdir -p android/kernel/6.12 cd android/kernel/6.12 repo init -u https://github.com/GrapheneOS/kernel_manifest-6.12.git -b 16-qpr2 repo sync -j8 ``` -------------------------------- ### Install udev Rules on Debian/Ubuntu Source: https://grapheneos.org/install/cli Installs the 'android-sdk-platform-tools-common' package on Debian and Ubuntu. Although the udev rules may be outdated, they contain the necessary configurations for Pixel devices. ```bash sudo apt install android-sdk-platform-tools-common ``` -------------------------------- ### Update SDK Source: https://grapheneos.org/build Command to update the installed SDK components. ```bash sdkmanager --update ``` -------------------------------- ### Sync Submodules and Dependencies Source: https://grapheneos.org/build Downloads necessary build dependencies and submodules. ```bash gclient sync -D --with_branch_heads --with_tags --jobs 32 ``` -------------------------------- ### Build target files package Source: https://grapheneos.org/build Initiates the build process for a target files package. ```bash m target-files-package ``` -------------------------------- ### Configure Temporary Directory for Flashing Source: https://grapheneos.org/install/cli Use a custom temporary directory if the default /tmp partition lacks sufficient space. ```shell mkdir tmp && TMPDIR="$PWD/tmp" ./flash-all.sh ``` -------------------------------- ### Run CTS Tradefed Harness Source: https://grapheneos.org/build Launch the CTS tradefed tool to begin the test harness environment. ```bash ./android-cts/tools/cts-tradefed ``` -------------------------------- ### Configure SDK Environment Variables Source: https://grapheneos.org/build Set ANDROID_HOME and update PATH for the SDK tools. ```bash export ANDROID_HOME="$HOME/android/sdk" export PATH="$HOME/android/sdk/cmdline-tools/latest/bin:$PATH" ``` -------------------------------- ### Navigate to Directory Source: https://grapheneos.org/install/cli Change the current working directory to the extracted factory image folder. ```shell cd DEVICE_NAME-install-VERSION ``` -------------------------------- ### Generate Signing Key Source: https://grapheneos.org/build Creates a PKCS12 keystore for signing Vanadium releases. ```bash keytool -genkey -v -keystore vanadium.keystore -storetype pkcs12 -alias vanadium -keyalg RSA -keysize 4096 -sigalg SHA512withRSA -validity 10000 -dname "cn=GrapheneOS" ```