Lock Your Device to One App
Learn how to enable App Pinning (Kiosk Mode) on Android to lock your device to a single application for a more controlled previewing environment.
JavaScript SDK Setup
Enabling App Pinning
async function pinRunningApp(session, packageName) {
// Apply app pinning to the currently launched application
const command = "'taskId=$(am stack list | grep -E -m 1 -o \"taskId=[0-9]+: " +
packageName +
"\" | grep -E -o \"[0-9]+\"); am task lock $taskId'";
await session.adbShellCommand(command);
}Disable System Toasts (Optional)
Last updated