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.
Parameters
Section titled “Parameters”| Name | Type | Required | Default | Constraints | Description |
|---|---|---|---|---|---|
metroPort | number | No | Metro port to connect to (default: auto-detect 8081/8082/19000/19006) | ||
platform | string | No | Filter target by platform (e.g. “ios”, “android”). If already connected to a different platform, forces reconnection to the correct target. | ||
targetId | string | No | Exact Hermes target id (from cdp_targets). Highest-precedence filter — picks one target precisely. Use when multiple targets share a platform and bundleId is ambiguous. | ||
bundleId | string | No | App 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. | ||
force | boolean | No | false | Force disconnect and reconnect even if already connected. Use to switch targets or recover from stale connections. |
cdp_connect()