Skip to main content
@capgo/capacitor-android-kiosk Device APIs Open source

Android Kiosk Capacitor plugin

Lock Android devices into kiosk mode with launcher functionality and hardware key control

Install

bun add @capgo/capacitor-android-kiosk bunx cap sync
npm, pnpm or yarn
  • npm install @capgo/capacitor-android-kiosk
  • pnpm add @capgo/capacitor-android-kiosk
  • yarn add @capgo/capacitor-android-kiosk

Guide

How to use Android Kiosk in Capacitor

Test on device

Download the Capgo app, then scan the QR code.

Android Kiosk plugin preview QR code

Using @capgo/capacitor-android-kiosk

Capacitor Android Kiosk Plugin for controlling kiosk mode and launcher functionality. This plugin is Android-only. For iOS kiosk mode, use the device's Guided Access feature.

Install

bun add @capgo/capacitor-android-kiosk
bunx cap sync

bunx cap sync copies the plugin's native code into your native projects. Run it again after every plugin upgrade.

Import

import { CapacitorAndroidKiosk } from '@capgo/capacitor-android-kiosk';

API at a glance

Method Description
isInKioskMode Checks if the app is currently running in kiosk mode.
isSetAsLauncher Checks if the app is set as the device launcher (home app).
enterKioskMode Enters kiosk mode, hiding system UI and blocking hardware buttons. Also starts a foreground keep-alive service so the app is less likely to be killed by the system. The app must be set as the device launcher for this to work effectively.
exitKioskMode Exits kiosk mode, restoring normal system UI and hardware button functionality. Also stops the foreground keep-alive service started in enterKioskMode().
setAsLauncher Opens the device's home screen settings to allow user to set this app as the launcher. This is required for full kiosk mode functionality.
setAllowedKeys Sets which hardware keys are allowed to function in kiosk mode. By default, all hardware keys are blocked in kiosk mode.

Examples

isInKioskMode()

Checks if the app is currently running in kiosk mode.

import { CapacitorAndroidKiosk } from '@capgo/capacitor-android-kiosk';

const { isInKioskMode } = await CapacitorAndroidKiosk.isInKioskMode();
console.log('Kiosk mode active:', isInKioskMode);

isSetAsLauncher()

Checks if the app is set as the device launcher (home app).

import { CapacitorAndroidKiosk } from '@capgo/capacitor-android-kiosk';

const { isLauncher } = await CapacitorAndroidKiosk.isSetAsLauncher();
console.log('Is launcher:', isLauncher);

enterKioskMode()

Enters kiosk mode, hiding system UI and blocking hardware buttons. Also starts a foreground keep-alive service so the app is less likely to be killed by the system. The app must be set as the device launcher for this to work effectively.

import { CapacitorAndroidKiosk } from '@capgo/capacitor-android-kiosk';

await CapacitorAndroidKiosk.enterKioskMode();

exitKioskMode()

Exits kiosk mode, restoring normal system UI and hardware button functionality. Also stops the foreground keep-alive service started in enterKioskMode().

import { CapacitorAndroidKiosk } from '@capgo/capacitor-android-kiosk';

await CapacitorAndroidKiosk.exitKioskMode();
console.log('Exited kiosk mode');

setAsLauncher()

Opens the device's home screen settings to allow user to set this app as the launcher. This is required for full kiosk mode functionality.

import { CapacitorAndroidKiosk } from '@capgo/capacitor-android-kiosk';

await CapacitorAndroidKiosk.setAsLauncher();
// User will be prompted to select this app as the home app

setAllowedKeys()

Sets which hardware keys are allowed to function in kiosk mode. By default, all hardware keys are blocked in kiosk mode.

import { CapacitorAndroidKiosk } from '@capgo/capacitor-android-kiosk';

// Allow volume keys only
await CapacitorAndroidKiosk.setAllowedKeys({
  volumeUp: true,
  volumeDown: true,
  back: false,
  home: false,
  recent: false
});

Full reference

Keep going from Using @capgo/capacitor-android-kiosk

If you are using Using @capgo/capacitor-android-kiosk to plan dashboard and API operations, connect it with @capgo/capacitor-android-kiosk for the implementation detail in @capgo/capacitor-android-kiosk, Getting Started for the implementation detail in Getting Started, API Overview for the implementation detail in API Overview, Introduction for the implementation detail in Introduction, and API Keys for the implementation detail in API Keys.

FAQ

Android Kiosk plugin FAQ

How do I install the Android Kiosk plugin in a Capacitor app?

Run "bun add @capgo/capacitor-android-kiosk" (or "npm install @capgo/capacitor-android-kiosk"), then run "bunx cap sync" so the iOS and Android projects pick up the native code. Import it from "@capgo/capacitor-android-kiosk" in your app code.

Does @capgo/capacitor-android-kiosk work with React, Vue and Angular?

Yes. Android Kiosk is a Capacitor package, so it works with any web framework that runs inside Capacitor, including Ionic, React, Vue, Angular, Svelte and plain JavaScript.

Which Capacitor version does @capgo/capacitor-android-kiosk support?

Capgo plugins follow Capacitor's major version: use the plugin major version that matches your Capacitor major version (for example plugin v8 with Capacitor 8). The compatibility table in the GitHub README lists the maintained versions.

Is @capgo/capacitor-android-kiosk free and open source?

Yes. The source code is public on GitHub at https://github.com/Cap-go/capacitor-android-kiosk/ and the package is free to install from npm. Bug reports and pull requests are welcome.

Can I update code that uses Android Kiosk without an App Store review?

Installing or upgrading the plugin changes native code, so it needs a new store build. After that, JavaScript, HTML and CSS changes that call the plugin can ship instantly with Capgo live updates.

Ship Android Kiosk changes without waiting for app review

Once the plugin is in your store build, Capgo live updates push your JavaScript, HTML and CSS changes to users in minutes.

Start with Capgo