Enrollment
Use automatic loopback registration for host-local .NET targets and scan one generic CLI host QR on a physical device.
Simulators, emulators, Mac Catalyst apps, and desktop apps register automatically with a running local CLI host. They do not need a QR, bundled host connection, generated file, certificate, or host address.
On a physical device, start the host and issue one generic any-app QR:
ansight host run
ansight pairing issue --qr
The Ansight and Ansight.Maui packages include the platform enrollment
reader. Initialize the all-in-one SDK, then open its scanner from a
developer-only app surface:
var options = Options.CreateBuilder()
.WithAnsightSdk()
.Build();
Runtime.InitializeAndActivate(options);
var result = await Runtime.HostConnection.ConnectAsync(
HostConnectionRequest.QrCode());
On Android, provide the current activity when your package configuration
requires it. After the first scan, the SDK stores a random installation id and
enrollment state in app-private storage. HostConnectionRequest.Auto() and
host auto-probe reconnect that installation on later launches.
If the app already owns a scanner, pass its result directly:
await Runtime.HostConnection.ConnectAsync(
HostConnectionRequest.PayloadText(qrPayload, "enrollment QR"));
The scanning SDK supplies its real bundle or package ID. The host registers the
app after authorization, so no app-specific invite or prior ansight app register command is required for the first connection.
Cellular Policy
QR enrollment, saved-profile reconnect, and explicit payload connections reject cellular network paths by default. A trusted mobile-data or personal-hotspot workflow can opt in with WithCellularHostConnections(). This can consume cellular data and does not change the clear-text development transport.
Unattended Physical-Device Tests
Call WithUnattendedProvisioning() only in an approved development/test variant. At process start, the iOS bridge reads a fresh one-use invite from ANSIGHT_ENROLLMENT_PAYLOAD; the Android bridge reads the ai.ansight.bootstrap.payload Activity intent string extra. The runtime consumes the invite before trying remembered profiles and retains the successful installation registration in platform-private storage.
Unattended provisioning is disabled by default. The invite is a bearer secret: never log it, embed it, or reuse it.