transport-appium
Appium transport — evaluates expressions inside Obsidian Mobile via WebView JavaScript injection. Manages vault lifecycle via localStorage and file push.
Configured via environmentOptions.obsidianTransport in vitest config:
environmentOptions: { obsidianTransport: { type: 'obsidian-android-appium', appiumUrl: 'http://localhost:4723', avdName: 'obsidian_test', },}For BrowserStack, set appiumUrl to the BrowserStack hub URL — the transport itself is hub-agnostic.
How vault registration works on mobile
Section titled “How vault registration works on mobile”Obsidian Mobile stores its vault registry in the WebView’s localStorage:
mobile-external-vaults— JSON array of registered vault paths -mobile-selected-vault— the currently active vault path -enable-plugin-<vaultPath>—"true"to enable the plugin system for the vault
To register a vault programmatically (without UI interaction):
- Push vault files to the device (e.g.
/sdcard/Documents/<Name>/.obsidian/app.json) 2. Switch toWEBVIEW_md.obsidiancontext 3. Set the localStorage entries 4. Calllocation.reload()— Obsidian re-reads localStorage and opens the vault
This avoids the onboarding flow entirely.
Classes
Section titled “Classes”| Class | Description |
|---|---|
| AppiumTransport | Transport that communicates with Obsidian Mobile via Appium WebView JS injection. Evaluates expressions by switching to the WEBVIEW_md.obsidian context and calling execute(). Manages vaults by writing to the WebView’s localStorage (which Obsidian uses as its vault registry on mobile) and pushing files to the device. |
Interfaces
Section titled “Interfaces”| Interface | Description |
|---|---|
| AppiumSessionInfo | Session connection info returned by AppiumTransport.getSessionInfo, used to reattach from another process. |
| AppiumTransportConfig | Configuration for the Appium transport. |