Skip to content

idevicedebug + ideviceimagemounter broken with iOS 17 #1452

Open

Description

@joshrad-dev

There seems to be a new structure or system for developer disk images and invoking debugserver. Debugging through Xcode in the "intended" way works the same.

Firstly, after iOS 16.4, there are no more disk images and signatures in the Xcode directory.
Screenshot 2023-06-05 at 6 46 30 PM

Second, when first plugging my iOS 17 iPhone into Xcode 15, I saw this message:
Screenshot 2023-06-05 at 5 28 45 PM

Also, I noticed there are certain specific device disk images at /Applications/Xcode-15-beta.app/Contents/Resources/CoreDeviceDDIs/iOS_DDI.dmg

version.plist.txt
Screenshot 2023-06-05 at 6 53 02 PM

https://mastodon.social/@siguza/109922466146143055

Activity

  1. joshrad-dev commented on Jun 6, 2023

    @joshrad-dev
    Author

    Result from trying to debug app using Xcode 14.3 after connecting to xcode 15 beta:

    Details

    Domain: com.apple.dt.DVTDeviceSupportFilesDDIError
    Code: 2
    Failure Reason: The device may be running a version of iOS (17.0 21A5248v) that is not supported by this version of Xcode.
    Recovery Suggestion: You may be able to resolve the issue by installing the latest version of Xcode from the Mac App Store or developer.apple.com.
    
    [missing string: 869a8e318f07f3e2f42e11d435502286094f76de]
    User Info: {
        DVTErrorCreationDateKey = "2023-06-06 02:13:33 +0000";
        DVTRadarComponentKey = 487927;
        DeviceType = "iPhone13,4";
        IDERunOperationFailingWorker = IDELaunchiPhoneLauncher;
    }
    
    Analytics Event: com.apple.dt.IDERunOperationWorkerFinished : {
        "device_model" = "iPhone13,4";
        "device_osBuild" = "17.0 (21A5248v)";
        "device_platform" = "com.apple.platform.iphoneos";
        "launchSession_schemeCommand" = Run;
        "launchSession_state" = 1;
        "launchSession_targetArch" = arm64e;
        "operation_duration_ms" = 6050;
        "operation_errorCode" = 2;
        "operation_errorDomain" = "com.apple.dt.DVTDeviceSupportFilesDDIError";
        "operation_errorWorker" = IDELaunchiPhoneLauncher;
        "operation_name" = IDEiPhoneRunOperationWorkerGroup;
        "param_consoleMode" = 0;
        "param_debugger_attachToExtensions" = 0;
        "param_debugger_attachToXPC" = 1;
        "param_debugger_type" = 3;
        "param_destination_isProxy" = 0;
        "param_destination_platform" = "com.apple.platform.iphoneos";
        "param_diag_MainThreadChecker_stopOnIssue" = 0;
        "param_diag_MallocStackLogging_enableDuringAttach" = 1;
        "param_diag_MallocStackLogging_enableForXPC" = 0;
        "param_diag_allowLocationSimulation" = 0;
        "param_diag_checker_tpc_enable" = 0;
        "param_diag_gpu_frameCapture_enable" = 0;
        "param_diag_gpu_shaderValidation_enable" = 0;
        "param_diag_gpu_validation_enable" = 1;
        "param_diag_memoryGraphOnResourceException" = 0;
        "param_diag_queueDebugging_enable" = 1;
        "param_diag_runtimeProfile_generate" = 0;
        "param_diag_sanitizer_asan_enable" = 0;
        "param_diag_sanitizer_tsan_enable" = 0;
        "param_diag_sanitizer_tsan_stopOnIssue" = 0;
        "param_diag_sanitizer_ubsan_stopOnIssue" = 0;
        "param_diag_showNonLocalizedStrings" = 0;
        "param_diag_viewDebugging_enabled" = 1;
        "param_diag_viewDebugging_insertDylibOnLaunch" = 1;
        "param_install_style" = 2;
        "param_launcher_UID" = 2;
        "param_launcher_allowDeviceSensorReplayData" = 0;
        "param_launcher_kind" = 0;
        "param_launcher_style" = 1;
        "param_launcher_substyle" = 256;
        "param_runnable_appExtensionHostRunMode" = 0;
        "param_testing_launchedForTesting" = 0;
        "param_testing_suppressSimulatorApp" = 0;
        "param_testing_usingCLI" = 0;
        "sdk_canonicalName" = "iphoneos16.4";
        "sdk_osVersion" = "16.4";
        "sdk_variant" = iphoneos;
    }
    
    
    System Information
    
    macOS Version 13.3.1 (Build 22E261)
    Xcode 14.3 (21801.3) (Build 14E5197f)
    Timestamp: 2023-06-05T19:13:33-07:00
    
  2. mexmer commented on Jun 6, 2023

    @mexmer

    this is not issue with libimobile, apple need to fix this, provide proper developer image for new OS version, then and only then, we can see how libimobile works with that.

  3. Dantee296 commented on Jun 7, 2023

    @Dantee296

    seems with ios 17 we need to modify image mounter to support "personalized developer images"

  4. doronz88 commented on Jun 7, 2023

    @doronz88

    i'm also currently dealing with these changes. i managed to get the personalized image mounted:
    https://github.com/doronz88/pymobiledevice3/pull/463/files

    it seems ios 16 also supports this image (i could get both the developer and the personalized image to mount simultaneously. one is at /Developer while the other is at /System/Developer)

    i'm currently researching the protocol changes done to the developer protocol. it seems it doesn't even use lockdownd any longer, but the "RSD" (RemoteServiceDiscovery) instead.

    NOTE: This new personalized image now requires an IM4M as the image signature from apple's ticket server just like during the update process

  5. zhuowei commented on Jun 7, 2023

    @zhuowei

    @doronz88 Apple did mention they switched to a new framework for device communication (https://techhub.social/@JTostitos/110499792791802006).
    Is the RemoteServiceDiscovery the same RemoteXPC framework used to talk with the Touch Bar / Studio Display (https://duo.com/labs/research/apple-t2-xpc)?

  6. doronz88 commented on Jun 8, 2023

    @doronz88

    @zhuowei it does bare some resemlence, at least the fact its over USB ethernet (ncm). I'm still trying to wrap my head arround it

  7. doronz88 commented on Jun 8, 2023

    @doronz88

    UPDATE: I'm getting the hang of it. It is RemoteXPC, but the existing tools will require some work before they can actually capture this

  8. mexmer commented on Jun 8, 2023

    @mexmer

    i'm kind of consused, so it doesn't go anymore on top of their mux protocol, but instead over tcp on top of rndis adapter (or wifi)?

    still kinda surprised it doesn't contact lockdown first to start mounter service, that would mean, that service is either running all time, or is started from xpc proxy on phone.

  9. doronz88 commented on Jun 8, 2023

    @doronz88

    The mounter service is still on top of lockdownd as you can see in my implementation over here:
    https://github.com/doronz88/pymobiledevice3/pull/463/files

    However, the DeveloperDiskImage interactions are purely over network afterwards. I'm currently working on a sniffer and parser for packets sent from the Interuments app and publish it once it is completed.

    This will be the first step in writing my own client and allowing others easier research.

  10. karthikgbbristol commented on Jun 8, 2023

    @karthikgbbristol

    That makes sense, @doronz88 I was tying to use socat over usbmux and found no traffic on it when running Instruments, making me wonder if they are using another interface.

  11. doronz88 commented on Jun 8, 2023

    @doronz88

    I'm currently sniffing it from my en19 network which is created when I connect the device over USB

  12. joshrad-dev commented on Jun 13, 2023

    @joshrad-dev
    Author

    @doronz88 Which files are the trust cache and build manifest? Where do you find each?

  13. doronz88 commented on Jun 14, 2023

    @doronz88

    @doronz88 Which files are the trust cache and build manifest? Where do you find each?

    Inside the IOS_DDI.dmg

  14. Geczy commented on Jun 14, 2023

    @Geczy

    where do you find the signature, im4m?

  15. doronz88 commented on Jun 15, 2023

    @doronz88

    Look at the code. I request it just like any TSS request

  16. 3 remaining items

  17. doronz88 commented on Jun 15, 2023

    @doronz88

    I'll add a CLI method, but anyway you can trigger the get_manifest_from_tss() and provide the correct build manifest

  18. Geczy commented on Jun 15, 2023

    @Geczy

    ah got it, yeah i can get the correct build manifest. thanks ill try that for now

  19. Geczy commented on Jun 15, 2023

    @Geczy

    fwiw, this can all be extracted automatically

    @mounter.command('mount-personalized', cls=Command)
    @click.argument('image', type=click.Path(exists=True, file_okay=True, dir_okay=False))
    @click.argument('trust-cache', type=click.Path(exists=True, file_okay=True, dir_okay=False))
    @click.argument('build-manifest', type=click.Path(exists=True, file_okay=True, dir_okay=False))
    @catch_errors
    def mounter_mount_personalized(lockdown: LockdownClient, image: str, trust_cache: str, build_manifest: str):
        """ mount personalized image """
        PersonalizedImageMounter(lockdown=lockdown).mount(Path(image), Path(build_manifest), Path(trust_cache))
        logger.info('Personalized image mounted successfully')

    from /Applications/Xcode-beta.app/Contents/Resources/CoreDeviceDDIs/iOS_DDI.dmg

    why the need to specify it one at a time?

  20. doronz88 commented on Jun 15, 2023

    @doronz88

    I'll want it to be supported on windows and Linux and since this is extracted from a DMG file it's not trivial to support other systems then macos. I'll eventually create a repo for the extracted files to remain platform independent. The you'll be able to simply connect the device and execute the mount without any additional parameters

  21. doronz88 commented on Jul 17, 2023

    @doronz88

    Just updating I already have a part of the Developer Services working.
    For the image mounter you can look and use the same implementation for libimobiledevice:
    https://github.com/doronz88/pymobiledevice3/blob/master/pymobiledevice3/services/mobile_image_mounter.py#L325

    In general, I created this repository which stores all the DeveloperDiskImages together with the new Personalized format as splitted files so we'll be able to mount them cross-plartform.
    https://github.com/doronz88/DeveloperDiskImage

  22. mforys commented on Aug 7, 2023

    @mforys

    When do you expect to have these fixes already merged to the official release branch?

  23. karthikgbbristol commented on Aug 9, 2023

    @karthikgbbristol

    Also, has anyone tested if this fork is able to retrieve performance metrics like Memory, CPU Usage etc.,
    @doronz88 great work btw!!! Just been looking at the changes you have made over the last few days

  24. yodaluca23 commented on Sep 18, 2023

    @yodaluca23

    So what is the state of this? What extra steps will be required to get this working on iOS 17? From my small understanding, we will at least need a Mac with Xcode to generate our personalized dev disk image, and some changes will be needed to the code, but after the changes are implemented, is that all we would need to do? get the personalized dev disk image and it'll work?

  25. kj54321 commented on Sep 22, 2023

    @kj54321

    Hi Folks, may we know the status? pymobiledevice3 only has work around on MacOS, but still no luck on Windows/Linux. Thanks

  26. chirag05k commented on Oct 30, 2023

    @chirag05k

    For those encountering problems running on iOS 17 devices with Xcode 14.x, there's a workaround mentioned in this Stack Overflow discussion: How to run on iOS 17 device using Xcode 14.

  27. jzhang1043 commented on Nov 17, 2023

    @jzhang1043

    `(myenv) ➜ ~ python -m pymobiledevice3 mounter auto-mount --rsd fdad:84fd:1e10::1 59338

    ...
    File "/opt/homebrew/anaconda3/envs/myenv/lib/python3.10/site-packages/pymobiledevice3/service_connection.py", line 118, in sendall
    self.socket.sendall(data)
    OSError: [Errno 9] Bad file descriptor
    `

    Hi, why am I having this error message when mounting DDI?

  28. gotwig commented on Dec 10, 2023

    @gotwig

    When I understand correctly there is a fix branch that just needs to be merged on main, or is that mac only?
    Is that possible soon :)?

  29. mexmer commented on Dec 10, 2023

    @mexmer

    no, libimobile has no support for this. there exists python implementation, if it works on other systems than os x, no idea, either test it, or ask author

    https://github.com/doronz88/pymobiledevice3

  30. victorvianna commented on Jul 8, 2025

    @victorvianna

    Re this comment: I just tested and pymobiledevice3 does work with iOS 18.5

    • sudo python3 -m pymobiledevice3 remote tunneld
    • pymobiledevice3 mounter auto-mount
    • pymobiledevice3 developer dvt launch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions