Get started with Lightbuild

This page shows you how to set up your environment for Lightbuild, create a Lightbuild project, and then build and test it.

Set up your environment

Lightbuild works in Android Studio and from the command line. For the best experience, we recommend you set up both:

For recommendations about which tool to use for each task, see Ways to use Lightbuild.

Create a project

You can create a Lightbuild project in Android Studio or with Android CLI.

Create a project in Android Studio Canary

To create a Lightbuild project in Android Studio Canary, follow these steps:

  1. In the Canary version of Android Studio, click New Project on the Android Studio Welcome screen, or select File > New > New Project from the main menu.
  2. Select a template that's compatible with Lightbuild, such as Empty Activity or Navigation UI Activity, and click Next.
  3. In the Build configuration language list, select Lightbuild.
  4. Configure the rest of your project's settings, and click Finish.

To have AI generate your project instead, follow the steps in Create a new project with AI, and select Lightbuild as the build configuration language on the final configuration screen before clicking Finish.

After Android Studio creates your project, you can build, run, test, and debug it as you would any other project.

Create a project with Android CLI

To create a Lightbuild project with Android CLI, run android create with the Lightbuild template name, your app's name, and an output directory to create:

android create empty-activity-lightbuild --name="Lightbuild Demo" --output=lightbuild-demo

Build, run, and test your app

To build, run, and test your project from the command line, run the following commands from your project's root directory.

To build the app module, run:

lightbuild build app

To run the app on a connected device or a running emulator, use the android run command in Android CLI:

android run --apks=app/build/app-debug.apk

To run all tests in the app-core module, run:

lightbuild test app-core

For more information, see Build from the command line.

Next steps