Miss any of our Open RFC calls?Watch the recordings here! »


1.3.1 • Public • Published

Bubblewrap CLI

Node CI Status

Bubblewrap is a Command Line Interface (CLI) that helps developers to create a Project for an Android application that launches an existing Progressive Web App (PWA) using a Trusted Web Activity (TWA).


Setting up the Environment

Get the Java Development Kit (JDK) 8.

The Android Command line tools requires the correct version of the JDK to run. To prevent version conflicts with a JDK version that is already installed, Bubblewrap uses a JDK that can unzipped in a separate folder.

Download a version of JDK 8 that is compatible with your OS from AdoptOpenJDK and extract it in its own folder.

Warning: Using a version lower than 8 will make it impossible to compile the project and higher versions are incompatible with the Android command line tools.

Get the Android command line tools

Download a version of Android command line tools that is compatible with your OS from https://developer.android.com/studio#command-tools. Create a folder and extract the downloaded file into it. This will further install the androidSdk and android SDK manager without needing to install the whole Android IDE.

Tell Bubblewrap where the JDK and Android command line tools are

When running bubblewrap for the first time, it will ask where it can find the JDK and Android command line tools. So, take note of the location where both were decompressed.

To ensure if you are taking note of the correct location, check if each directory contains the following files:

  • The OpenJDK path should contain bin,com,include ..
  • The AndroidSDK path should contain tools which should have bin, cli

Updating the location of the JDK and / or the Android command line tools.

If the location for the JDK or the Android command line tools have been setup with the wrong path or if their location has changed after the initial configuration, the location for either of those can be changed by editing the configuration file at ${USER_HOME}/.llama-pack/llama-pack-config.json.

Sample llama-pack-config.json


Quickstart Guide

Installing Bubblewrap

npm i -g @bubblewrap/cli

Initializing an Android Project

Generate an Android project from an existing Web Manifest:

bubblewrap init --manifest https://my-twa.com/manifest.json

When initalizing a project, Bubblewrap will download the Web Manifest and ask you to confirm the values that should be used when building the Android project.

It will also ask you for the details needed to generate a signing key, used to sign the app before uploading to the Play Store.

Building the Android Project

bubblewrap build

When building the project for the first time, the Android Build Tools will need to be installed. The tool will inkove the installation process for the build tools. Make sure to read and accept the license agreement before proceeding. This process will install the other required files inside the directory/decompressed root directory of the android CLI package.

As a result of the build step, the tool will generate a signed APK (app-release-signed.apk) that can be uploaded to the Play Store. You will also need to deploy a Digital Asset Links file to validate your domain. The TWA Quick Start Guide explains how to extract the information needed to generate it.




Initializes an Android project for Trusted Web Activity from a Web Manifest. The init script will parse the Web manifest and generate default valuers for the Android project, where possible. It will prompt the user to confirm or input values where one could not be generated.

bubblewrap init --manifest="<web-manifest-url>" [--directory="<path-to-output-location>"]


  • --directory: path where to generate the project. Defaults to the current directory.


Builds the project into a final APK that can be uploaded to the Play Store.


bubblewrap build [--skipPwaValidation]


  • --skipPwaValidation: skips validating the wrapped PWA against the Quality Criteria.


Regenerates the Android project files from a twa-manifest.json file.


bubblewrap update [--appVersionName="<version-string>"] [--skipVersionUpgrade] [--manifest="<path-twa-manifest>"]


  • --appVersionName: version name to be used on on the upgrade. Ignored if --skipVersionUpgrade is used.
  • --skipVersionUpgrade: skips upgrading appVersion and appVersionCode.
  • --manifest: directory where the client should look for twa-manifest.json.


Validates a PWA agains the Quality Criteria for being using in a Trusted Web Activity.


bubblewrap validate --url=[pwa-url]


Install the application generated in the output command to a device connected for debugging.


bubblewrap install [--apkFile="/path-to-apk/apkfile.apk"]


Displays a list of commands and options.


bubblewrap help


See CONTRIBUTING for more.


See LICENSE for more.


This is not a Google product.




npm i @bubblewrap/cli

DownloadsWeekly Downloads






Unpacked Size

113 kB

Total Files


Last publish


  • avatar