Troubleshooting
Windows blocks the first launch
Section titled “Windows blocks the first launch”- Windows says it protected your PC? Windows builds aren’t code-signed yet, so SmartScreen may warn on first launch. Choose More info, then Run anyway.
The desktop app doesn’t see my app
Section titled “The desktop app doesn’t see my app”- Is Metro running on port 8081? The Console and Network panels find your app through Metro’s
debugger at
http://localhost:8081. If Metro runs on another port, see Metro isn’t on port 8081. - Is the desktop app running on the same machine? The SDK connects to
ws://localhost:9340. On Android,localhostis the emulator or device itself. Emulators fall back to10.0.2.2automatically, and the desktop app forwards the port to attached devices whenadbis installed. If a device still doesn’t connect, runadb reverse tcp:9340 tcp:9340yourself. - Is this a development build? The SDK is inert in production builds by design. Check the
exported
runtime: it should be'dev'. - Did
init()run? Call it once, as early as possible in your entry file.
Metro isn’t on port 8081
Section titled “Metro isn’t on port 8081”If you start Metro on another port, for example npx expo start --port 8082, the Console and
Network panels and other Metro-backed features can’t find your app on the default port. Panels
that use the SDK bridge, such as Redux and TanStack Query, still work, and the Connection
panel shows No Metro found on port …. Open
Settings > Connection and set Metro port to the port Metro prints at startup. If your app
uses a recent SDK and Use the port reported by the app is on, Xerlock picks the port up itself
once the app connects. See Ports.
The Console or Network panel is missing
Section titled “The Console or Network panel is missing”They are hidden only when the SDK is connected and your app passed console: false or
network: false. Remove that option, or pass true.
Time travel or edits behave strangely
Section titled “Time travel or edits behave strangely”Both replace state wholesale, so they rely on immutable updates. Direct mutation of state corrupts the history. They also roll back state only: requests already sent and persisted writes are not undone.
xerlockMiddleware() doesn’t typecheck
Section titled “xerlockMiddleware() doesn’t typecheck”Make sure xerlockMiddleware() is the innermost middleware when combined with devtools, persist
or immer. Xerlock’s types assume your tsconfig resolves packages the way a React Native app does,
with "customConditions": ["react-native"], which the Expo and React Native tsconfig presets set.
init rejects my config
Section titled “init rejects my config”Config keys are checked strictly. A misspelt plugin name, an unknown key, or true for an opt-in
plugin is a type error. See Types.
Connection
Section titled “Connection”- Xerlock connects to one app through Metro at a time, and has no way to pick between them. With several apps running, it reconnects to the last app it was connected to, otherwise the first one Metro lists.
- On Android, Xerlock forwards port
9340to every emulator and device listed byadb devices, so the SDK reaches the desktop app over USB too. This needsadbfrom the Android SDK, found throughANDROID_HOME,ANDROID_SDK_ROOT,~/Library/Android/sdkor yourPATH. - On a physical iPhone, the panels that work through Metro still work, but the SDK can’t reach the desktop app, so the panels that need the SDK don’t appear. Use the iOS Simulator for those.
- SDK says Version mismatch: the SDK in your app and the desktop app don’t match. A message says which to update: The Xerlock SDK in your app is out of date. Update @xerlock/client. or Your app uses a newer Xerlock SDK. Update Xerlock.
- SDK bridge says Unavailable: …: another program is using port
9340, such as another copy of Xerlock. Quit it and restart Xerlock. - Status is connected but SDK says Not connected: check that
initruns when your app starts, in a development build. See How the SDK connects.
Console
Section titled “Console”- The Console keeps the latest 5,000 entries and drops older ones.
console.group,console.tableandconsole.traceshow as ordinary log entries, andconsole.clear()doesn’t clear the panel.- Entries don’t link to the source file. To see where an error came from, log the
Errorobject and expand itsstack. - If nothing appears, check the Connection panel. “No Metro found on port …” means Metro isn’t running, or runs on a port other than the one in Settings > Connection.
Native logs
Section titled “Native logs”- Native logs are only collected while the Native logs panel is open, and the list starts empty each time you open it. Open it before you reproduce a problem.
- The panel keeps the latest 5,000 entries. “N lines skipped” means the app logged faster than the desktop app could keep up, and some lines were dropped.
- On iOS, only simulators are supported, not physical devices. Lines logged before the panel opened aren’t shown, and neither are debug-level lines.
- On Android, emulators and devices listed by
adb devicesare supported. Opening the panel shows the app’s last 500 lines, and the panel picks the app up again after it restarts. - If the panel shows an error instead of logs:
- No booted iOS simulator was found: boot the simulator your app runs on.
- … is not installed on the booted simulator: install and run your app on that simulator.
- No Android device or emulator is connected: start the emulator, or connect and authorise the device.
- Several Android devices match this app: close the emulators you aren’t using.
Network
Section titled “Network”- The Network panel keeps the latest 1,000 requests and drops older ones.
- When a request is redirected, only the final response is reported. The Info tab shows its Final URL, and cookies set by earlier responses aren’t shown.
- Throttling only slows requests made with
fetchorXMLHttpRequest. Images loaded by native components and requests made by native SDKs aren’t throttled, andFormDatauploads get no upload delay. - Running
init()again while throttling is on resets throttling in your app, though the banner stays. Turn throttling off and on again to apply it. - “React Native disabled network inspection for this app session” means React Native stopped reporting requests. Fully close and relaunch your app.
- If nothing appears, check the Connection panel. “No Metro found on port …” means Metro isn’t running, or runs on a port other than the one in Settings > Connection.
- On React Native below 0.83, the panel can’t read requests natively, so it shows what the SDK sees
from JS and can’t show:
- Requests made before
init(),<Image>loads and requests made by native SDKs. - Requests made by importing
fetchfromexpo/fetch, or through afetchsaved beforeinit(). - The request’s
Cookieheader. - Request bodies that aren’t strings, and response bodies that aren’t text or are over 1 MB, so images have no preview.
- Redirects. The row shows the original URL and isn’t flagged.
- Timing beyond when the request started and ended.
- Throttling.
- Requests made before
TanStack Query
Section titled “TanStack Query”- The TanStack Query panel is missing: pass your
QueryClientastanstackQueryininit().
- Mutations are read-only, and their result isn’t shown.
- Values and array items edited one at a time are strings, numbers, booleans or
null. To add an object or array, use Overwrite data.
Debugger
Section titled “Debugger”- The app doesn’t pause when it throws. Set a breakpoint in the
catchor just before the throw. - There are no conditional breakpoints, logpoints or keyboard shortcuts for stepping.
- The Debugger attaches to one device at a time. If more than one device runs your app on the same Metro, the Connection panel shows which one it uses. Close the app on the others.
- No sources yet: check the app is running and the Metro port in Settings > Connection matches the one Metro is on.
- This file’s source isn’t available: the bundle’s source map has no source for this file.
- Props, state and hooks can’t be edited from the panel, and profiles can’t be saved or loaded.
- React Native DevTools is using the component inspector: only one tool can use React’s component inspector at a time, and React Native DevTools has taken it over. Click Reconnect to take it back.
- The React panel needs React Native 0.76 or later: the app doesn’t expose React’s developer tools. Check it is a development build.
- Couldn’t read the component tree from the app: click Reconnect.
- Connect an app to inspect its React components: check the app is running and the Metro port in Settings > Connection matches the one Metro is on.
Zustand
Section titled “Zustand”- Stores can only be registered in
init(). A store created later doesn’t appear untilinit()runs again with it. - The Zustand panel is missing: pass
zustandtoinit(), and check that every value instoresis a store. One that isn’t turns the panel off. - Changes show keys instead of names: add
xerlockMiddleware()to the store, innermost of its middleware.
- Only top-level functions are listed as actions. Functions inside nested objects aren’t.
- The Redux panel is missing: pass
reduxtoinit(), and create the store withxerlockEnhancer(). - Actions from thunks or middleware are missing: put
xerlockEnhancer()afterapplyMiddleware. - A type isn’t offered on the Dispatch tab: check the console for a warning that its entry in
actionshas notype.
- Xerlock shows one Redux store per app.
- Before and after states are kept for the last 200 actions. Older actions can’t be diffed or unwound to.
Storage
Section titled “Storage”- The Storage panel is missing: pass
storagetoinit(). - AsyncStorage changes don’t appear until you refresh: pass
init()the same AsyncStorage object your app writes with.
- SecureStore can’t list its keys. Look them up by name.
- AsyncStorage and SecureStore store strings only. MMKV stores strings, numbers and booleans.
- MMKV doesn’t record a value’s type, so the type shown is worked out from the stored value and can occasionally be wrong.
- Keys are deleted one at a time. There’s no way to clear a whole storage from the panel.
- “The keychain is locked”: unlock the device, then click Retry.
Database
Section titled “Database”- The panel says “No databases yet”: pass
databasetoinit(), or add a connection.
BEGIN,COMMITand other transaction statements are refused.- A query’s result shows at most 1000 rows.
- BLOB values show their size only and can’t be edited.
- “Your app has disconnected”: its databases leave the list, except the one you’re viewing, which stays until you leave the panel. Reconnect your app to bring them back.
- “The SSH server’s host key has changed”: if you trust the new key, click Forget beside Pinned host key in the connection’s settings, then connect again.
Commands
Section titled “Commands”- The Commands panel is missing: check that
commandsisn’tfalse. - “No commands on file”: no
registerCommand()call has run yet. Check that the file calling it is imported.
- The desktop app waits 10 seconds for a command to finish. After that it shows The command could not be run. The app did not answer as expected., while the handler carries on in the app.
- A command whose
registerCommand()call you delete stays listed until the app reloads.
Navigation
Section titled “Navigation”- No navigation commands: check that
navigationis set, that the ref comes fromuseNavigationContainerRef()and is passed to your navigation container, and thatinitruns in auseEffect. Xerlock ignores a value that isn’t a navigation ref, without an error.
- Without Expo Router, only mounted navigators are listed. A screen in a navigator that hasn’t
rendered yet, such as a lazy tab you haven’t opened, appears after your app first visits it.
Running a command for a name that isn’t mounted fails with
Route "…" isn't mounted right now. - With Expo Router, the
navigation.resetlist also includes Expo Router’s own routes, such as__root,+not-foundand_sitemap. - Search params are found by reading source, so they are a best guess. A key read with a computed
name, such as
params[name], isn’t found, and files innode_modulesaren’t read. Keys added while the app runs appear after a reload, or once the app opens the screen with them. navigation.goBackfails withNothing to go back toon the first screen.navigation.navigateandnavigation.resetare missing while the container hasn’t mounted. The other commands fail withNavigation isn't ready yetuntil it has.
Notifications
Section titled “Notifications”- “Add
notificationsto the Xerlock client config to deliver through the app instead.”: the FCM broadcast failed and no handler is set. PassexpoNotificationsoronRemoteMessage. - “The app has no handler for incoming notifications.”: pass
expoNotificationsoronRemoteMessage. - “The app’s notification handler threw an error.”: the toast shows the error your handler threw.
- iOS notifications can only go to an iOS Simulator, not a physical device.
- “Couldn’t run xcrun.”: install Xcode and its command line tools.
- “No iOS Simulator is booted.”: boot one, with your app running on it.
- “Couldn’t run adb.”: install the Android platform tools.
- “The device hasn’t authorised this computer.”: accept the USB debugging prompt on the device.
- “This emulator image doesn’t allow root, which the FCM broadcast needs.” or “… has no FCM
receiver to take the broadcast.”: see Sending over adb, or pass a handler to
notificationsto deliver through your app. - The panel doesn’t keep a history of sent notifications.
Settings
Section titled “Settings”Connection
Section titled “Connection”- No Metro found on port … in the Connection panel: Metro isn’t running, or runs on another port. Set Metro port to the port Metro prints when it starts.
- The SDK’s own port,
9340, can’t be changed. See SDK port.
Environments
Section titled “Environments”- Unknown variable: …: no variable has that name in the active environment or Base. Nothing is sent until it’s fixed.
- Secret has no saved value: …: the secret was never saved, or the keychain couldn’t be read. Type its value again.
- Couldn’t save the secret to the keychain: your system refused the keychain write. Check that the keychain is unlocked.
- Add connected app is disabled while no app is connected.
- Couldn’t start: …: usually another program is using the port. Change MCP port, or quit the other program, and turn the server on again.
- An agent says a tool is turned off in Xerlock’s MCP settings: raise that area’s permission.
- Native logs are only collected while the Native logs panel is open.
Version
Section titled “Version”- Couldn’t check for updates: the check failed, for example while offline. Click Check for updates to try again.
- Couldn’t install the update: the install failed, with the reason. The update stays ready, so you can try again.