storage · setStorage · clearStorage
This tool on every surface: CLI · MCP · Python · JavaScript · Go · Java · .NET
Save, restore or clear the current WebView's storage state: its cookies and its origin's localStorage and sessionStorage, in the shape Vibium saves — {cookies, origins: [{origin, localStorage, sessionStorage}]} — so a state saved by one restores in the other. These call app_storage.
storage
storage(): Promise<StorageState>
The page's storage state.
setStorage
setStorage(state: StorageState): Promise<void>
Restore a saved state; each origin's storage goes only into a page on it.
clearStorage
clearStorage(): Promise<void>
Empty the page's cookies, localStorage and sessionStorage.
Examples
Save the WebView's cookies and web storage
import { writeFileSync } from 'node:fs'
const state = await device.storage()
writeFileSync('state.json', JSON.stringify(state))
The same call from the command line, mobium storage -o state.json, printed on an Android 15 emulator:
saved state.json

mobium storage -o state.json on an Android 15 emulator
Restore them in a later run
await device.setStorage({ cookies: [], origins: [] })
The same call from the command line, mobium storage restore state.json, printed on an Android 15 emulator:
restored 1 cookie(s) and https://mobiumapp.test's storage
{
"cookies": [
{
"name": "visited",
"value": "yes",
"domain": "mobiumapp.test",
"path": "/",
"expires": 1790759538.232578,
"secure": true
}
],
"origins": [
{
"origin": "https://mobiumapp.test",
"localStorage": [
{
"name": "visits",
"value": "2"
}
],
"sessionStorage": [
{
"name": "lastVisit",
"value": "visit 2"
}
]
}
]
}
| Before | After |
|---|---|
![]() | ![]() |
mobium storage restore state.json on an Android 15 emulator

