Skip to content

Local Dev Setup

Fran Aguilera edited this page Oct 9, 2025 · 15 revisions

Pre-requisites

See the dependencies section of our main runbook for instructions on installing the pre-requisites.

iOS

Xcode

Xcode 16.2 is used to compile Capture SDK on macOS. Download it from https://developer.apple.com/download/.

If you install Xcode directly from the App store you will likely not get the specific version above. Either install it manually or override the version in your .bazelrc like this:

build --xcode_version=16.2

Bazel can also get confused about the status of Xcode installation so if you run into issues with stale version confusion do:

./bazelw clean --expunge
./bazelw shutdown

If you are using a different version of Xcode/simulator you may also need to adjust the following settings while running the commands (or in .bazelrc configuration) to match your environment:

./bazelw build --ios_simulator_device="iPhone 15"
./bazelw build --ios_simulator_version=17.5
./bazelw build --xcode_version=16.1

Running the tests

To run the unit tests on the command-line, use:

./bazelw test //test/platform/swift/unit_integration/core:test --ios_simulator_device="iPhone 16"

where the simulator device is any of the sims installed via Xcode settings > Components

To run the tests in Xcode, select "iOS Capture Unit Integration Tests" from the filter in the middle of the top bar and select Product > Test (Command + U) from the menu.

Running example app

To create Xcode project iOS Capture SDK:

./bazelw run :xcodeproj
xed . // opens generated project

To build run the iOS example app:

# optionally pass --ios_multi_cpus=x86_64 

# build
./bazelw build --config ios-hello-world :ios_app

# run
./bazelw run --config ios-hello-world :ios_app

Android

Local dev setup has only been tested on MacOS running ARM-compatible models.

1. Set up JDK

Azul provides JDK releases that are ARM compatible (do not require Rosetta).

Using Homebrew to setup your machine, you can run the following commands to get the correct Zulu JDKs installed.

brew tap mdogan/zulu
brew install --cask zulu-jdk8 zulu-jdk11 zulu-jdk17

To install without Homebrew you can follow these instructions: https://docs.azul.com/core/zulu-openjdk/install/macos

2. Import demo app project into Android Studio

  • Install Android Studio. The latest verified-to-work version is Android Studio Narwhal Feature Drop | 2025.1.2 RC 1 (July 18, 2025). When asked to choose between default or custom installation selecting standard works fine.

Gradle: Open Capture SDK project in Android Studio

Setup the environment, open Android Studio.

  1. Install cargo-ndk which is used to build the Rust shared library.
cargo install cargo-ndk --version 3.4.0
  1. Open Android Studio from terminal (e.g. open -a "Android Studio")

Given that recent AS versions may cause an issue with the PATH, you may get an error _like Failed to run cargo --version. You probably don't have 'cargo' executable in PATH.

Alternatively you can also set your path via launchctl setenv PATH "your_path_details" as it persistent from restarts.

  1. Open... and select folder /capture-sdk/platform/jvm. This should automatically kick off the Gradle sync process.

    • If you get an NDK not installed error:

    • Go to Tools > SDK Manager > Android SDK > SDK Tools. Make sure that "Show Package Details" is checked and install the NDK version that is required by the project (currently 27.2.12479018).

  2. Run/debug the test app either on an emulated or physical device

    • If you receive a cargo error due to missing architectures, run:
          rustup update
          rustup target add aarch64-linux-android
          rustup target add x86_64-linux-android

Bazel

The recommended way of building and running the test app using bazel is via the command line.

Useful Bazel Commands

Build the standalone capture AAR library (for arm 64): ./bazelw build --config=android --android_platforms=@rules_android//:arm64-v8a :capture_aar

Build the HelloWorld test app (for arm 64): ./bazelw build --config=android --android_platforms=@rules_android//:arm64-v8a :android_app

You can then iinstall the generated apk into a connected device or emulator with: adb install ./bazel-bin/examples/android/android_app.apk

Open Capture SDK project in Android Studio

Set up the environment, open Android Studio.

  1. Add a new bazel project:

  1. Select your repository root path and hit Next:

  1. Import the .bazelproject file from the root directory and hit Next:

  1. You will see a screen similar to the one below, hit Finish and the project should auto-sync:

  1. Run the project.

Run tests

To run only the JVM tests from command line with bazel use: ./bazelw test //platform/jvm/...

  • If you get an error trying to run tests from Android Studio, you need to install LLVM brew install llvm

and add it to your path, e.g.

echo 'export PATH="/opt/homebrew/opt/llvm/bin:$PATH"' >> ~/.zshrc

Clone this wiki locally