6.2 KiB
Connected iOS Device Access
Summary
World Manager can browse Minecraft Bedrock content from a trusted iPhone or iPad on macOS using Apple's private MobileDevice.framework and the House Arrest service.
Connected-device sources are modeled as normal MinecraftSource values, but they are not scanned through a live filesystem mirror. The current implementation asks the device for library item summaries, metadata, icons, sizes, and directory listings through AppleMobileDeviceSourceAccess. Only explicit materialization operations, such as reveal/export/share, mirror an item subtree into a temporary local directory.
Current Flow
-
SourceLibraryowns aConnectedDeviceRuntimerefresh loop when a connected-device access method is configured. -
AppleMobileDeviceSourceAccess.listConnectedDevices()enumerates devices throughAppleMobileDeviceAccess.connectedDevices(). -
AppleMobileDeviceSourceAccess.listAccessibleContainers(for:)lists app containers and prioritizescom.mojang.minecraftpe. -
ConnectedDeviceSourcePickerViewlets the user add a device-backed Minecraft source. -
ConnectedDeviceSourceFactorycreates a stable synthetic source identifier:wmminecraft-device://<device-udid>/<bundle-id>?mode=documents -
SourceScanExecutorscans the source through the genericSourceAccessMethodprotocol. -
AppleMobileDeviceSourceAccess.discoverItemscallsminecraftLibrarySnapshotfor item summaries andminecraftMetadataBatchfor metadata. -
Preview icons, size metrics, directory contents, and full item materialization are loaded lazily through the same source-access method.
This keeps UI, indexing, export, and persistence mostly source-agnostic while allowing connected devices to avoid a full upfront mirror.
Minecraft Container
The tested Minecraft bundle identifier is:
com.mojang.minecraftpe
Minecraft exposes a vendable Documents surface. The working Minecraft content root for House Arrest VendDocuments is:
Documents/games/com.mojang
The app treats that value as a vend-relative path stored on DeviceAppContainer.minecraftFolderRelativePath.
Expected subfolders under that root:
minecraftWorldsresource_packsbehavior_packsskin_packsworld_templates
House Arrest Details
The implementation uses the explicit House Arrest flow in the Objective-C bridge:
- Start
com.apple.mobile.house_arrest. - Send
VendDocuments. - Receive the vend response.
- Use AFC against the returned service connection.
The direct AMDeviceCreateHouseArrestService helper returned InstallationLookupFailed / e80000b7 on the tested device, so it is not the primary path.
The AFC root for this vend should not be treated as a normal / filesystem root. Paths are relative to the vend surface, and Minecraft content is reached through Documents/games/com.mojang.
Runtime Behavior
Connected-device sources use a staged refresh strategy:
- Availability is derived from current device presence and trust state.
- Trusted devices are available.
- Locked or untrusted devices are limited.
- Missing or inaccessible devices are disconnected.
- When a source becomes available,
SourceSyncRuntimecan queue a reconcile scan instead of a full scan if cached content exists.
Scan execution uses fewer workers for connected-device sources than local folders to avoid overloading AFC/MobileDevice calls.
During scan:
minecraftLibrarySnapshotreturns candidate content items.minecraftMetadataBatchreturns display names, UUIDs, versions, minimum engine versions, and world pack references.- Icons are loaded with
minecraftIconBatchor individual file reads and cached throughImageCacheStore. - Size information is loaded through
pathMetricsBatch. - Directory previews call
listDirectory.
During materialization:
materializeItemmirrors one remote item subtree intoNSTemporaryDirectory()/WMMConnectedDeviceReveal/....ContentPackageExportermirrors the selected item into archive staging when exporting connected-device content.- Temporary materialized folders are treated as disposable.
Persistence
Connected-device sources are persisted in the SQLite source cache with:
- source identifier
- source origin and device/container metadata
- access descriptor
- availability
- raw item cache
- source snapshot
- last scan date
On app launch, cached sources and items are restored before availability refreshes complete, so offline device-backed sources can still show cached results.
Relevant Files
World Manager for Minecraft/SourceAccess/ConnectedDevice/AppleMobileDevice/AppleMobileDeviceBridge.mWorld Manager for Minecraft/SourceAccess/ConnectedDevice/AppleMobileDevice/AppleMobileDeviceBridge.hWorld Manager for Minecraft/SourceAccess/ConnectedDevice/AppleMobileDevice/AppleMobileDeviceAccess.swiftWorld Manager for Minecraft/SourceAccess/ConnectedDevice/AppleMobileDevice/AppleMobileDeviceSourceAccess.swiftWorld Manager for Minecraft/SourceAccess/ConnectedDevice/ConnectedDeviceSourceFactory.swiftWorld Manager for Minecraft/SourceAccess/ConnectedDevice/ConnectedDeviceSourcePickerView.swiftWorld Manager for Minecraft/Services/Sources/ConnectedDevice/SourceConnectedDeviceRuntime.swiftWorld Manager for Minecraft/Services/Sources/Scanning/SourceScanExecution.swift
Developer Probe
The local probe harness is useful for debugging MobileDevice behavior outside the app:
Scripts/run_mobile_device_probe.sh summary
Scripts/run_mobile_device_probe.sh apps
Scripts/run_mobile_device_probe.sh details com.mojang.minecraftpe
Scripts/run_mobile_device_probe.sh probe-paths com.mojang.minecraftpe
Scripts/run_mobile_device_probe.sh mirror com.mojang.minecraftpe 'Documents/games/com.mojang' /tmp/wmm-minecraft-device-mirror
These commands require a trusted connected device and generally need to run outside restricted automation sandboxes.
Caveats
MobileDevice.framework, House Arrest, and AFC are private Apple interfaces.- Behavior can change across macOS, iOS, iPadOS, and Minecraft releases.
- Device access requires trust, unlock state, and a vendable app container.
- Connected-device export/reveal operations may be slower than local folder operations because they materialize remote content on demand.