dotnet / dotnet/macios

mlaunch: Improve output when failing to install app on device because the device is locked

Open
#21,542 0 comments 0 reactions 0 assignees View on GitHub
enhancement mlaunch
Dominant language
C#
Stars
2.9k
Forks
576
Avg merge
2d 12h
Merged PRs (30d)
123

Description

Sample output:

```
INFO: /Users/ema/Library/Caches/Xamarin/XMA/SDKs/dotnet/packs/Microsoft.iOS.Sdk.net9.0_18.0/18.0.9600-net9-rc2/tools/bin/mlaunch --devname "Ema's iPhone 15 Pro" --installdev "/Users/ema/Library/Caches/Xamarin/mtbs/builds/MauiApp25/595cb581a5f7090bc1eecc32d178e5faa1f105165bc54b8c89c16c81548aab4a/bin/Debug/net9.0-ios/ios-arm64/device-builds/iphone16.2-18.0.1/MauiApp25.app" --install-progress --sdkroot "/Applications/Xcode_16.0.0.app/Contents/Developer" -sdk 0.0
INFO: Deploying MauiApp25 on Ema's iPhone 15 Pro...
INFO: FunctionName = -[PersonalizedImage mountRemoteImage:serverTicket:imageDigest:trustCacheURL:error:]
INFO: Failed to mount /private/var/tmp/CoreDevice_DDI_Staging_501/0DC75A3D-6BB2-4EF8-A0ED-1AE74E1900B9/Restore/022-16019-313.dmg: 0xe80000e2 (kAMDMobileImageMounterDeviceLocked: The device is locked.) (com.apple.mobiledevice error -402652958 (0xE80000E2))
INFO: LineNumber = 2068
INFO: 16:41:40 Enabling developer disk image services.
INFO: ERROR: The developer disk image could not be mounted on this device. (com.apple.dt.CoreDeviceError error 12040 (0x2F08))
INFO: Options = {
INFO: MountedBundlePath = "file:///private/var/tmp/CoreDevice_DDI_Staging_501/0DC75A3D-6BB2-4EF8-A0ED-1AE74E1900B9/";
INFO: DeviceIdentifier = 0DC75A3D-6BB2-4EF8-A0ED-1AE74E1900B9
INFO: xcrun devicectl -j /var/folders/k6/n_65pl1n0pv2pb6qnwpdzv300000gn/T/tmpzh0sz4.tmp device install app --device "Ema's iPhone 15 Pro" /Users/ema/Library/Caches/Xamarin/mtbs/builds/MauiApp25/595cb581a5f7090bc1eecc32d178e5faa1f105165bc54b8c89c16c81548aab4a/bin/Debug/net9.0-ios/ios-arm64/device-builds/iphone16.2-18.0.1/MauiApp25.app
INFO: DDIPath = /Library/Developer/DeveloperDiskImages/iOS_DDI.dmg
INFO: FunctionName = -[PersonalizedImage mountImage:]
INFO: NSLocalizedRecoverySuggestion = Unlock the device and try again.
INFO: ----------------------------------------
INFO: Error mounting image: 0xe80000e2 (kAMDMobileImageMounterDeviceLocked: The device is locked.) (com.apple.mobiledevice error -402652958 (0xE80000E2))
INFO: FunctionName = AMDeviceRemoteMountPersonalizedBundle
INFO: LineNumber = 2145
INFO: ----------------------------------------
INFO: Failed to mount image: 0xe80000e2 (kAMDMobileImageMounterDeviceLocked: The device is locked.) (com.apple.mobiledevice error -402652958 (0xE80000E2))
INFO: NSURL = file:///Library/Developer/DeveloperDiskImages/iOS_DDI.dmg
INFO: }
INFO: UseCredentials = 0;
```

We should do better than this.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by locating mlaunch's handling of the xcrun devicectl install output and the kAMDMobileImageMounterDeviceLocked error shown here. Compare the current diagnostic with the recovery suggestion to unlock the device; done means this failure produces a concise, actionable message and the relevant install behavior is covered by tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, ios
Domain
cli, devtools
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.