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
public Map<String, Object> storage()
The current page's storage state, in the shape Vibium saves: cookies, and origins, each with origin, localStorage and sessionStorage.
@return the storage state
setStorage
public void setStorage(Map<String, Object> state)
Restores a saved state: its cookies, and each origin's storage into the page only if the page is on that origin.
@param state a storage state, as storage() answers it
clearStorage
public void clearStorage()
Empties the current page's cookies, localStorage and sessionStorage.
Examples
Save the WebView's cookies and web storage
Map<String, Object> state = device.storage(); // cookies, and each origin's storage
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
device.setStorage(Map.of("cookies", List.of(), "origins", List.of()));
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

