AppiumTransport.registerVault method
AppiumTransport › registerVault
Registers a vault on mobile by pushing files and configuring localStorage.The registration flow: 1. Push a minimal
.obsidian/app.json to the device so Obsidian recognizes the vault — **unless one is already there**, which is the usual case, since register pushes the whole vault first and that carries the run's real app.json across. See pushObsidianMarker: the marker is a truncating overwrite, so pushing it unconditionally destroyed the headless defaults it had just been handed. 2. Switch to the WebView context 3. Add the vault to localStorage (mobile-external-vaults, mobile-selected-vault, enable-plugin-<path>) 4. Trigger location.reload() so Obsidian re-reads localStorage and opens the vault 5. Wait for globalThis.app to exist (the app's cold start), then — on a separate, tighter budget — for app.workspace.layoutReadyExisting vault registrations in localStorage are preserved (append, not overwrite) — except the **harness's own**
temp-vault-* registrations from earlier runs, which are pruned when AppiumTransportConfig.shouldSweepLeftovers is on. Their directories are already gone (the factory sweeps them before the app launches), and it is this registry — not the filesystem — that Obsidian enumerates at startup, so leaving them is what makes each failed run slow the next one down.Signature:
registerVault(vaultPath: string): Promise<void>Parameters:
| Parameter | Type | Description |
|---|---|---|
| vaultPath | string | The absolute path to the vault on the host machine. |