Developer Mode via AMFI XPC
How iOS developer mode is enabled programmatically, based on TrollStore's implementation.
XPC Service
Mach service: com.apple.amfi.xpc
AMFI (Apple Mobile File Integrity) daemon exposes an XPC endpoint for developer mode control on iOS 16+.
Required Entitlement
Without this entitlement the XPC connection to amfid is rejected.
Message Protocol
Messages are serialized using private CoreFoundation-XPC bridge functions:
Request
NSDictionary with a single key:
Actions
Response
XPC reply dict contains a "cfreply" key holding the CF-serialized response:
Response fields:
Arming Flow
- Query status (
kAMFIActionStatus) - If already enabled, done
- Send arm (
kAMFIActionArm) - Device must reboot; user selects "Turn On" in the prompt
- Developer mode is now active
Arming does not enable developer mode immediately. It sets a flag that triggers the enable prompt on the next reboot. Disabling (kAMFIActionDisable) takes effect immediately.
TrollStore Reference
Source: references/TrollStore/RootHelper/devmode.m
TrollStore separates privileges: the main app has no AMFI entitlement; all privileged operations go through RootHelper which has com.apple.private.amfi.developer-mode-control.
Key functions:
checkDeveloperMode()— returns current state, YES on iOS <16 (devmode doesn't exist)armDeveloperMode(BOOL *alreadyEnabled)— check + arm in one callstartConnection()— creates and resumes XPC connection tocom.apple.amfi.xpcsendXPCRequest()— CF dict → XPC message → sync reply → CF dict
vphoned Implementation
Added as devmode capability in vphoned guest agent:
Protocol Messages
Status query:
Enable (arm):
Entitlements
Added to Scripts/VPhoned/entitlements.plist:
Host-Side API (historical design)
The calls below record the earlier XPC design. The current guest API exposes
the status query as VPhoneGuestControl.isDeveloperModeEnabled(); there is no
host-side enable action in the current menu.
Both methods use sendRequest() with pending request tracking — the response is returned via async throws, not logged to console. Callers (e.g. VPhoneMenuConnect) display results as NSAlert sheets on the VM window.