5.4 KiB
iOS Device Access Notes
Summary
This project can now read Minecraft Bedrock content directly from a connected iPhone or iPad on macOS using MobileDevice.framework and House Arrest.
The app does not scan the device live through custom file APIs. Instead, it:
- Detects a connected trusted device with
MobileDevice.framework. - Opens House Arrest for
com.mojang.minecraftpe. - Uses
VendDocuments. - Mirrors the proven Minecraft subtree into a temporary local folder.
- Hands that local folder to the existing
WorldScanner.
That keeps the rest of the app filesystem-based.
Proven Findings
Correct bundle ID
Minecraft on the tested device is:
com.mojang.minecraftpe
App metadata
The app record reported:
UIFileSharingEnabled = 1LSSupportsOpeningDocumentsInPlace = 1
So Minecraft does expose a vendable Documents surface.
Correct vend root
House Arrest VendDocuments succeeds, but the Minecraft content is not rooted at:
games/com.mojang
The proven path is:
Documents/games/com.mojang
Proven subfolders
These paths were verified through AFC on the real device:
Documents/games/com.mojang/minecraftWorldsDocuments/games/com.mojang/resource_packsDocuments/games/com.mojang/behavior_packsDocuments/games/com.mojang/world_templates
Important API Findings
AMDeviceCreateHouseArrestService
The direct helper path still returned a device-side error on the tested device:
InstallationLookupFailede80000b7
So the app currently relies on the explicit vend flow instead:
AMDeviceSecureStartService("com.apple.mobile.house_arrest")AMDServiceConnectionSendMessagewithVendDocumentsAMDServiceConnectionReceiveMessage- Create AFC from the returned service connection
VendDocuments vs VendContainer
VendDocuments is the working path for Minecraft on the tested device.
AFC path behavior
The AFC root is not a normal / root for this vend. Examples:
"/"returned AFC status0xA"/games/com.mojang"returned AFC status0x8"Documents/games/com.mojang"worked
So code should use the proven vend-relative path instead of assuming a container root layout.
Current Project Shape
Source Access Architecture
Source intake is now organized around access methods rather than one-off services.
SourceAccess/Core- shared contracts and the
SourceAccessCoordinator
- shared contracts and the
SourceAccess/LocalFolder- the local disk access method
SourceAccess/ConnectedDevice- connected-device source creation and picker UI
SourceAccess/ConnectedDevice/AppleMobileDevice- the built-in Apple mobile-device transport
The key abstraction is SourceAccessMethod.
Each access method is responsible for:
- turning a
MinecraftSourceinto a localPreparedScanRoot - cleaning up that prepared root when scanning finishes
That keeps the rest of the app indifferent to how a source is reached.
App path
User flow:
SourcesSidebarViewopens the connected-device sheet.ConnectedDeviceSourcePickerViewlets the user select a device/app and a subpath.AppleMobileDeviceSourceAccessis the active connected-device access method.
Scan-root preparation
SourceAccessCoordinator chooses between:
- local folder sources
- connected device sources
For connected devices:
- the built-in
AppleMobileDeviceSourceAccess - future connected-device access methods can implement the same contracts
Mirror behavior
The MobileDevice fallback:
- mirrors the subtree into a temporary directory
- returns that directory as
PreparedScanRoot.rootURL - cleans it up with
CleanupBehavior.deleteTemporaryDirectory
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/Core/SourceAccessCoordinator.swiftWorld Manager for Minecraft/SourceAccess/LocalFolder/LocalFolderSourceAccess.swiftWorld Manager for Minecraft/Models/SourceOrigin.swiftWorld Manager for Minecraft/SourceAccess/ConnectedDevice/ConnectedDeviceSourcePickerView.swift
Developer CLI
A local probe harness was added for iteration:
Scripts/run_mobile_device_probe.shTools/mobile_device_probe.m
Useful commands:
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 generally need to run outside the agent sandbox to access the real connected device.
Known Cleanup Targets
Not part of the device-access implementation itself:
layoutSubtreeIfNeededwarning: SwiftUI/AppKit layout issueduplicate column name: bookmark_data: persistence migration issue- preview actor-isolation warnings in
PreviewFixtures.swift
Recommendation
Keep the CLI probe and this document.
They provide a reproducible path for future device-access debugging without going back through GUI-based experimentation.