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:
- Android Studio Canary: To work with Lightbuild projects in an IDE, install the latest Canary version of Android Studio. Stable versions of Android Studio don't support Lightbuild projects. You can install a Canary version alongside your stable version.
- Lightbuild CLI: To build and test Lightbuild projects from the command
line, or to have AI agents work on them, install the Lightbuild CLI. First,
install Android CLI, or update it to the latest
version with
android update. Then, follow the steps in Install the Lightbuild CLI.
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:
- 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.
- Select a template that's compatible with Lightbuild, such as Empty Activity or Navigation UI Activity, and click Next.
- In the Build configuration language list, select Lightbuild.
- 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
- Learn how a Lightbuild project is organized in Lightbuild project structure.
- Learn about the settings in each build file in the Lightbuild configuration reference.
- Learn how to sign your app and publish it on Google Play in Publish your Lightbuild app.
- If you're familiar with Kotlin DSL, see how Kotlin DSL configuration maps to Lightbuild in Compare Lightbuild with Kotlin DSL.