iPhoneConnect: ## Unable to mount developer disk image, Error Domain=com.apple.dtdevicekit Code=-402652958

Viewed 6752

After upgrading to macOS High Sierra, I'm getting this error when running xcodebuild from the terminal.

2017-09-26 10:11:03.990 xcodebuild[1333:141317]  iPhoneConnect: ## Unable to mount developer disk image, (Error Domain=com.apple.dtdevicekit Code=-402652958 "Development cannot be enabled while your device is locked." UserInfo={NSLocalizedDescription=Development cannot be enabled while your device is locked., com.apple.dtdevicekit.stacktrace=(
    0   DTDeviceKitBase                     0x0000000116c26a0d DTDKCreateNSError + 113
    1   DTDeviceKitBase                     0x0000000116c27251 DTDK_AMDErrorToNSError + 1135
    2   DTDeviceKitBase                     0x0000000116c681b7 -[DTDKMobileDeviceToken mountDeveloperDiskImage:withError:] + 782
    3   DTDeviceKitBase                     0x0000000116c68a6e -[DTDKMobileDeviceToken mountDeveloperDiskImageWithError:] + 488
    4   IDEiOSSupportCore                   0x0000000116b4c495 __37-[DVTiOSDevice(Connect) hasConnected]_block_invoke_2 + 133
    5   DVTFoundation                       0x000000010ada60eb __DVTDispatchGroupAsync_block_invoke + 806
    6   libdispatch.dylib                   0x00007fff54d447a2 _dispatch_call_block_and_release + 12
    7   libdispatch.dylib                   0x00007fff54d3cf64 _dispatch_client_callout + 8
    8   libdispatch.dylib                   0x00007fff54d50110 _dispatch_continuation_pop + 599
    9   libdispatch.dylib                   0x00007fff54d478e0 _dispatch_async_redirect_invoke + 703
    10  libdispatch.dylib                   0x00007fff54d3eb56 _dispatch_root_queue_drain + 515
    11  libdispatch.dylib                   0x00007fff54d3e902 _dispatch_worker_thread3 + 101
    12  libsystem_pthread.dylib             0x00007fff550001ca _pthread_wqthread + 1387
    13  libsystem_pthread.dylib             0x00007fff54fffc4d start_wqthread + 13
), NSLocalizedRecoverySuggestion=Please unlock your device and reattach. (0xE80000E2)., NSLocalizedFailureReason=Please unlock your device and reattach. (0xE80000E2).}) {
    NSLocalizedDescription = "Development cannot be enabled while your device is locked.";
    NSLocalizedFailureReason = "Please unlock your device and reattach. (0xE80000E2).";
    NSLocalizedRecoverySuggestion = "Please unlock your device and reattach. (0xE80000E2).";
    "com.apple.dtdevicekit.stacktrace" = (
    0   DTDeviceKitBase                     0x0000000116c26a0d DTDKCreateNSError + 113
    1   DTDeviceKitBase                     0x0000000116c27251 DTDK_AMDErrorToNSError + 1135
    2   DTDeviceKitBase                     0x0000000116c681b7 -[DTDKMobileDeviceToken mountDeveloperDiskImage:withError:] + 782
    3   DTDeviceKitBase                     0x0000000116c68a6e -[DTDKMobileDeviceToken mountDeveloperDiskImageWithError:] + 488
    4   IDEiOSSupportCore                   0x0000000116b4c495 __37-[DVTiOSDevice(Connect) hasConnected]_block_invoke_2 + 133
    5   DVTFoundation                       0x000000010ada60eb __DVTDispatchGroupAsync_block_invoke + 806
    6   libdispatch.dylib                   0x00007fff54d447a2 _dispatch_call_block_and_release + 12
    7   libdispatch.dylib                   0x00007fff54d3cf64 _dispatch_client_callout + 8
    8   libdispatch.dylib                   0x00007fff54d50110 _dispatch_continuation_pop + 599
    9   libdispatch.dylib                   0x00007fff54d478e0 _dispatch_async_redirect_invoke + 703
    10  libdispatch.dylib                   0x00007fff54d3eb56 _dispatch_root_queue_drain + 515
    11  libdispatch.dylib                   0x00007fff54d3e902 _dispatch_worker_thread3 + 101
    12  libsystem_pthread.dylib             0x00007fff550001ca _pthread_wqthread + 1387
    13  libsystem_pthread.dylib             0x00007fff54fffc4d start_wqthread + 13
);
}

Code builds and tests pass.

3 Answers

Seems like running the tests from Xcode in all platforms "unlocks" the simulators, and the error no longer appears when running xcodebuild from the command line.

I had the same problem, and the error log clearly identifies the issue, which is a locked iOS device. When you run the compile with the device active and unlocked, the error does not occur.

My problem is this. After searching a lot and not finding a solution, I happened to find it, well for my case.

But before I was intrigued by the publication of a single screen app and few components work, ie in the same environment and mobile and macOS a full app could not publish and the simple all right.

Well absordial but the simple lack of "/" at the end of "RemotePath" was my problem.

Error-> RemotePath = StartUp / Documents

OK-> RemotePath = StartUp / Documents /

I did not have any more problems.

Related