Skip to content

cdp_connect

Explicitly connect to a Hermes debug target. Use when you need to target a specific platform, port, or bundle, or reconnect after a manual disconnect. When multiple Hermes targets exist (common after app restarts on Expo Dev Client — zombie host.exp.Exponent pages linger alongside fresh app pages), pass targetId (exact id from cdp_targets) or bundleId (e.g. “com.myapp”) to disambiguate. Use force=true to always reconnect regardless of current state.

NameTypeRequiredDefaultConstraintsDescription
metroPortnumberNoMetro port to connect to (default: auto-detect 8081/8082/19000/19006)
platformstringNoFilter target by platform (e.g. “ios”, “android”). If already connected to a different platform, forces reconnection to the correct target.
targetIdstringNoExact Hermes target id (from cdp_targets). Highest-precedence filter — picks one target precisely. Use when multiple targets share a platform and bundleId is ambiguous.
bundleIdstringNoApp bundle id to match against target.description (e.g. “com.myapp.dev”). Filters out zombie Expo Go host pages when the real app target is present. B111/D635.
forcebooleanNofalseForce disconnect and reconnect even if already connected. Use to switch targets or recover from stale connections.
cdp_connect()