App persistence for Smart TV
BrowserStack preserves your Smart TV app and its state across sessions by default.
BrowserStack App Automate preserves your Smart TV app and its state across consecutive sessions on the same dedicated device. App state includes cached content, sign-in credentials, stored preferences, and any data the app writes to its local data directory. Sign in once and your app stays installed, authenticated, and configured. Uploading a new build applies as an in-place upgrade, so state carries over by default.
How app persistence works
App state is wiped only when one of the following is true:
-
browserstack.forceReinstallis set totrue. - The app is uploaded with a different bundle ID (Android TV and Apple TV only).
In all other cases, including uploading a new build with the same bundle ID, the build applies as an in-place upgrade and state is preserved.
Platform support
App persistence and browserstack.forceReinstall are available on all supported Smart TV platforms:
| Platform | Persistence by default | Reinstall supported |
|---|---|---|
| Android TV (Nvidia Shield, Amazon Fire TV) | Yes | Yes |
| Apple TV (tvOS) | Yes | Yes |
| Roku TV | Yes | Yes |
Force a clean install
If you pass capabilities inside bstack:options, set forceReinstall: true there. It is equivalent to browserstack.forceReinstall when passed outside bstack:options. The following snippet uses the bstack:options form.
App persistence is enabled by default. No additional capability is required. The snippet below is only needed when you want to force a clean install at session start.
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability("platformName", "<platform-name>");
capabilities.setCapability("platformVersion", "<version>");
capabilities.setCapability("deviceName", "<device-name>");
capabilities.setCapability("app", "<app-url>");
capabilities.setCapability("automationName", "<automation-name>");
HashMap<String, Object> bstackOptions = new HashMap<String, Object>();
bstackOptions.put("forceReinstall", true);
bstackOptions.put("projectName", "<project-name>");
bstackOptions.put("buildName", "<build-name>");
bstackOptions.put("sessionName", "<session-name>");
bstackOptions.put("dedicatedDevice", "true");
bstackOptions.put("deviceId", "<device-id>");
capabilities.setCapability("bstack:options", bstackOptions);
Reinstall behavior by platform
Each Smart TV platform has its own install mechanics, which determine when app data is preserved and when it is cleared. A version bump or code change alone never clears state. The build is always applied as an in-place upgrade.
On Roku, all sideloaded builds share a single dev channel. Every build is installed by overwriting that channel in place, so BrowserStack does not compare binaries or versions. A build is identified by its app hash; a new hash triggers a channel overwrite but leaves the data partition intact, so state is preserved. browserstack.forceReinstall set to true deletes the channel before installing. It is the only way to clear app state on Roku.
| Scenario | Default | With Reinstall |
|---|---|---|
| Re-run the same build | App state preserved | App state wiped |
| Upload a new build | App state preserved | App state wiped |
Frequently asked questions
Do I need to change anything in my test script to get app persistence?
No. App persistence is the default on every supported Smart TV platform. Your existing sessions benefit automatically as long as browserstack.forceReinstall is not set to true, and the bundle ID is unchanged on Android TV and Apple TV.
What happens when I upload a new version of my app?
Uploading a new build applies as an in-place upgrade, so your app’s cache, sign-in credentials, and stored state are kept. State is only reset if you set browserstack.forceReinstall to true, or if you change the app’s bundle ID on Android TV or Apple TV, which installs it as a new package.
Does uploading a new build reset app state?
A version or code change alone does not reset state. The new build applies as an in-place upgrade on the device. To clear state, set browserstack.forceReinstall to true (works on all platforms), or change the bundle ID on Android TV or Apple TV to install the app as a brand-new package. On Roku, browserstack.forceReinstall is the only option.
We're sorry to hear that. Please share your feedback so we can do better
Contact our Support team for immediate help while we work on improving our docs.
We're continuously improving our docs. We'd love to know what you liked
We're sorry to hear that. Please share your feedback so we can do better
Contact our Support team for immediate help while we work on improving our docs.
We're continuously improving our docs. We'd love to know what you liked
Thank you for your valuable feedback!