The private distribution cookie for a project's development builds.
One random 256-bit cookie per app (keyed by its bundle id), shared by iOS,
Android and the Mac-side node, so concurrent mob.connect sessions attach
without restarting the app under different credentials. It lives in an
owner-only directory under ~/.mob/dist_cookies/, reaches the app only at
deploy/launch time, and is never printed. A hand-started node loads it with
Node.set_cookie(MobDev.DistCookie.for_project!()) from the project, which
keeps it out of process arguments (--cookie would show it in ps).
Apps built against a mob from before MOB-49 still answer to the public
:mob_secret. Without an explicit cookie, connect/2 tries the private
cookie first and falls back to that legacy one with a warning, so existing
apps stay reachable until they are redeployed.
Summary
Functions
Cookies to try against a device node, in order.
Connects to node, trying each cookie in cookies in order.
Returns the private cookie for the current project, creating it on first use.
Validates an explicit cookie given on the command line.
Functions
Cookies to try against a device node, in order.
An explicit cookie (--cookie) is the only candidate. Without one, the
project's private cookie comes first and the legacy public cookie second.
The first entry is also the right default cookie for the Mac-side node.
Connects to node, trying each cookie in cookies in order.
Returns {:ok, cookie} with the cookie that worked. An already connected
node answers with the cookie it was connected under, untouched: OTP reports
an existing connection as success without a handshake, so trying a
candidate on it would prove nothing and overwrite the cookie that did
authenticate. When no cookie works, the node's cookie is reset to the first
candidate: a per-node cookie also authenticates incoming connections
claiming that name, so the legacy public cookie must not stay set for a
node that did not need it.
@spec for_project!() :: atom()
Returns the private cookie for the current project, creating it on first use.
Validates an explicit cookie given on the command line.