Skip to content

cdp_connect

Explicitly connect to a Hermes debug target. Use when you need to target a specific platform or port, or reconnect after a manual disconnect. If already connected to a different platform than requested, automatically reconnects to the correct target. 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.
forcebooleanNofalseForce disconnect and reconnect even if already connected. Use to switch targets or recover from stale connections.
cdp_connect()