Prerequisites

If you already have these installed, skip to the verification steps below.
The Momentic CLI requires the following tools:
  • Node.js: version 20.17.0 or later
  • Java JDK: version 24 recommended
  • Android Studio: latest stable version, including platform tools.
    • ANDROID_HOME must be set in your shell to your SDK install folder.

Install Node.js

Download Node.js 20. To verify your installation:
node -v  # v20.x.x

Install Java

Download JDK version 24 from Oracle. To verify your installation:
java --version  # should show JDK 24
If java --version is not found, re-open your terminal or ensure JAVA_HOME/bin is in your PATH.

Install Android Studio (+ SDK + Platform Tools)

Download Android Studio and complete the first-run setup wizard. If prompted, ensure you include the following tools:
  • Android SDK Platform-Tools (ADB)
  • Android Emulator

Set ANDROID_HOME

Set the ANDROID_HOME environment variable in your shell. This should point to the root of your Android SDK installation. Typical installation locations are listed below:
  • macOS: /Users/<username>/Library/Android/sdk
  • Windows: C:\\Users\\<username>\\AppData\\Local\\Android\\Sdk
  • Linux: /home/<username>/Android/Sdk
echo 'export ANDROID_HOME="$HOME/Library/Android/sdk"' >> ~/.zshrc
echo 'export PATH="$ANDROID_HOME/platform-tools:$ANDROID_HOME/emulator:$PATH"' >> ~/.zshrc
source ~/.zshrc

Verify your setup

Run the following commands; all should succeed without errors:
node -v                # expect v20.x
java --version         # expect JDK 24
echo $ANDROID_HOME     # prints your SDK path
If any check fails:
  • Re-open your terminal or source your profile after editing it.
  • Ensure Platform-Tools are installed via Android Studio’s SDK Manager.
  • Confirm ANDROID_HOME matches your actual SDK path.
  • On Windows, ensure environment variables are set in System Properties and restart your shell.

Installation

Get your API key

To get started, log in to Momentic Cloud and generate an API key.
You can export the API key in your shell configuration file (usually .bashrc or .zshrc) like so:
export MOMENTIC_API_KEY=your-api-key

Install the CLI

Before proceeding, ensure a package.json file already exists in your project. If you don’t, run npm init, yarn init, or pnpm init to create the file beforehand. Install the momentic-mobile CLI by running the following command in your terminal:
npm install momentic-mobile --save-dev

Starting building locally

Initialize a new project

If you already have a momentic.config.yaml file for browser testing, you can skip this step and reuse the same project.
Create a new Momentic project by running the following command in your terminal:
npx momentic-mobile init

Start the local app

Start the local app UI by running the following command in your terminal:
npx momentic-mobile app