Loading page

Install Android tools

Before running the Android CLI commands, launch Android Studio and complete its initial setup. Then, install Android SDK Command-line Tools from the SDK Manager.

Set ANDROID_HOME to your Android SDK directory. Update the default path to match the SDK and tools installation location on your system:

    

        
        
export ANDROID_HOME="$HOME/Library/Android/sdk"
export PATH="$ANDROID_HOME/platform-tools:$ANDROID_HOME/cmdline-tools/latest/bin:$PATH"

    
    

        
        
export ANDROID_HOME="$HOME/Android/Sdk"
export PATH="$ANDROID_HOME/platform-tools:$ANDROID_HOME/cmdline-tools/latest/bin:$PATH"

    

Install Android SDK Platform 36, the Android NDK and Platform-Tools using your existing Android CLI. Set the ANDROID_NDK_HOME environment variable:

    

        
        
android --sdk="$ANDROID_HOME" sdk install platform-tools platforms/android-36 ndk/30.0.16248370
export ANDROID_NDK_HOME="$ANDROID_HOME/ndk/30.0.16248370"

    
Note

This Learning Path was tested with NDK r30 (30.0.16248370), the 2026 LTS release . Other NDK versions haven’t been tested but are expected to work.

Install Bazelisk

Download and set up Bazelisk:

    

        
        

```bash
brew install bazelisk
```


    
    

        
        


```bash
curl -fL -o bazelisk https://github.com/bazelbuild/bazelisk/releases/latest/download/bazelisk-linux-amd64
mkdir -p "$HOME/.local/bin"
install -m 755 bazelisk "$HOME/.local/bin/bazel"
echo 'export PATH="$HOME/.local/bin:$PATH"' >> "$HOME/.bashrc"
source "$HOME/.bashrc"
bazel --version
```



    

Check your Android device

Connect one Android device and authorize debugging from your host computer. Check the adb connection, GPU model, and driver:

    

        
        
adb devices
adb shell 'dumpsys SurfaceFlinger | grep GLES'

    

The output should identify your connected device and its GPU. The output is similar to:

    

        
        10.1.16.154:5555        device

 ------------RE GLES (Ganesh)------------
GLES: ARM, Mali-G1-Ultra MC12, OpenGL ES 3.2 v1.r54p1-11eac0.5ac4efe.15f36b8c6518df15cadf5aced2a1638a.1c3d0d1d631f33b0b8a673ce08c68e340f851541

        
    

ML Drift supports different OpenCL backends, but profiling with Arm Streamline requires a device with a Mali GPU.

Get the source

Clone ML Drift and enter the repository directory:

    

        
        
git clone https://github.com/google-ai-edge/ml-drift.git
cd ml-drift

    

What you’ve accomplished and what’s next

You’ve prepared host tools and device connection.

Next, you’ll build and run the sample.