LogoPear Docs
ReferencesBareModules

bare-apk

Reference for bare-apk: Android APK and app-bundle packaging tools for Bare.

bare-apk provides Android packaging tools for Bare: build an Android App Bundle (.aab) from a manifest, derive an APK set, and produce an installable .apk. It's pure JavaScript (it shells out to the Android build tools) and is used in the Android packaging path of bare-build.

npm i bare-apk

Usage

const { createAppBundle, createAPK } = require('bare-apk')

await createAppBundle('./path/to/AndroidManifest.xml', './app.aab')
await createAPK('./app.aab', './app.apk')

API

await createAppBundle(manifest, out[, options])

Build an Android App Bundle (.aab) from an AndroidManifest.xml.

Options include:

options = {
  targetSDK: DEFAULT_TARGET_SDK,
  // Additional files and directories to include in uncompressed format
  include: [],
  // Resource directory to compile and compress
  resources
}

await createAPKSet(bundle, out[, options])

Produce an APK set from an app bundle.

Options include:

options = {
  universal: false,
  archive: true,
  sign: false,
  keystore,
  keystoreKey,
  keystorePassword
}

await createAPK(bundle, out[, options])

Produce an installable .apk.

Options include:

options = {
  sign: false,
  keystore,
  keystoreKey,
  keystorePassword
}

constants

ConstantDescription
ANDROID_HOMEThe Android SDK root directory.
DEFAULT_MINIMUM_SDKThe default minimum Android SDK API level.
DEFAULT_TARGET_SDKThe default target Android SDK API level.

See also

On this page