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.
The most common reasons why your iPad or iPhone won't connect to Wi-Fi include a poor connection signal, an incorrect Wi-Fi password, your Wi-Fi or mobile data settings, restricted network settings, or even a bulky phone case. A weak Wi-Fi connection can also mean you need to increase your internet speed.
Reset your Network Settings. If you're using iOS or iPadOS 15 or later, tap Settings > General > Transfer or Reset [Device] > Reset > Reset Network Settings. If you're using iOS or iPadOS 14 or earlier, tap Settings > General > Reset > Reset Network Settings.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With