Xcode 11.7 Failed to prepare device for development

Since updating my iPhone to iOS 13.7 and Xcode to 11.7 I am unable to connect my iPhone as a development device. Under "Errors and Warnings" in the "Devices" window, I see "Failed to prepare device for development.", details below.

I have tried relaunching Xcode, rebooting iMac and rebooting iPhone and reconnecting the iPhone multiple times with no luck. Any suggestions?

Code Block Details
Failed to prepare device for development.
Domain: com.apple.dtdevicekit
Code: 806
Recovery Suggestion: If you are certain that Xcode supports development on this device, try disconnecting and reconnecting the device.
User Info: {
  AssociatedMobileDeviceFunction = AMDeviceMountImage;
  DVTRadarComponentKey = 487927;
  NSLocalizedFailure = "This operation can fail if the version of the OS on the device is newer than the version of Xcode that is running.";
}
--
Could not allocate a resource.
Domain: com.apple.dt.MobileDeviceErrorDomain
Code: -402653181
User Info: {
  DVTRadarComponentKey = 261622;
  MobileDeviceErrorCode = "(0xE8000003)";
  "com.apple.dtdevicekit.stacktrace" = (
0  DTDeviceKitBase           0x0000000120d7181a DTDKCreateNSErrorFromAMDErrorCode + 233
1  DTDeviceKitBase           0x0000000120db08a9 -[DTDKMobileDeviceToken _mountDeveloperDiskImage:withError:] + 1034
2  DTDeviceKitBase           0x0000000120db15e7 58-[DTDKMobileDeviceToken mountDeveloperDiskImageWithError:]_block_invoke + 779
3  libdispatch.dylib          0x00007fff6adfa658 _dispatch_client_callout + 8
4  libdispatch.dylib          0x00007fff6ae066ec _dispatch_lane_barrier_sync_invoke_and_complete + 60
5  DTDeviceKitBase           0x0000000120db127a -[DTDKMobileDeviceToken mountDeveloperDiskImageWithError:] + 199
6  IDEiOSSupportCore          0x0000000120c11741 37-[DVTiOSDevice(Connect) hasConnected]_block_invoke_2 + 265
7  DVTFoundation            0x00000001071cc5c4 DVT_CALLING_CLIENT_BLOCK + 7
8  DVTFoundation            0x00000001071d145b __DVTDispatchGroupAsync_block_invoke + 1194
9  libdispatch.dylib          0x00007fff6adf96c4 _dispatch_call_block_and_release + 12
10 libdispatch.dylib          0x00007fff6adfa658 _dispatch_client_callout + 8
11 libdispatch.dylib          0x00007fff6adfc890 _dispatch_continuation_pop + 534
12 libdispatch.dylib          0x00007fff6adfbf16 _dispatch_async_redirect_invoke + 703
13 libdispatch.dylib          0x00007fff6ae08957 _dispatch_root_queue_drain + 326
14 libdispatch.dylib          0x00007fff6ae09097 _dispatch_worker_thread2 + 92
15 libsystem_pthread.dylib       0x00007fff6b0549f7 _pthread_wqthread + 220
16 libsystem_pthread.dylib       0x00007fff6b053b77 start_wqthread + 15
);
}
--
System Information
macOS Version 10.15.6 (Build 19G2021)
Xcode 11.7 (16142)


Still having this issue with Xcode 12 GM and iPhone XR running iOS 13.7 and also iPhone 7 running iOS 14 GM. On a separate Mac using these devices with Xcode works, so I suspect the issue is on the Mac. What can I do to "reset" the dev environment on this Mac?

Code Block Failed to prepare device for development.
Domain: com.apple.dtdevicekit
Code: 806
Recovery Suggestion: If you are certain that Xcode supports development on this device, try disconnecting and reconnecting the device.
User Info: {
  AssociatedMobileDeviceFunction = AMDeviceMountImage;
  DVTRadarComponentKey = 487927;
  NSLocalizedFailure = "This operation can fail if the version of the OS on the device is newer than the version of Xcode that is running.";
}
--
Could not allocate a resource.
Domain: com.apple.dt.MobileDeviceErrorDomain
Code: -402653181
User Info: {
  DVTRadarComponentKey = 261622;
  MobileDeviceErrorCode = "(0xE8000003)";
  "com.apple.dtdevicekit.stacktrace" = (
0  DTDeviceKitBase           0x0000000126ef493f DTDKCreateNSErrorFromAMDErrorCode + 220
1  DTDeviceKitBase           0x0000000126f30f58 -[DTDKMobileDeviceToken _mountDeveloperDiskImage:withError:] + 1024
2  DTDeviceKitBase           0x0000000126f31978 58-[DTDKMobileDeviceToken mountDeveloperDiskImageWithError:]_block_invoke + 609
3  libdispatch.dylib          0x00007fff69233658 _dispatch_client_callout + 8
4  libdispatch.dylib          0x00007fff6923f6ec _dispatch_lane_barrier_sync_invoke_and_complete + 60
5  DTDeviceKitBase           0x0000000126f316b5 -[DTDKMobileDeviceToken mountDeveloperDiskImageWithError:] + 188
6  IDEiOSSupportCore          0x0000000126d85d8c 37-[DVTiOSDevice(Connect) hasConnected]_block_invoke_2 + 258
7  DVTFoundation            0x000000010ae322ba DVT_CALLING_CLIENT_BLOCK + 7
8  DVTFoundation            0x000000010ae37107 __DVTDispatchGroupAsync_block_invoke + 1191
9  libdispatch.dylib          0x00007fff692326c4 _dispatch_call_block_and_release + 12
10 libdispatch.dylib          0x00007fff69233658 _dispatch_client_callout + 8
11 libdispatch.dylib          0x00007fff69235890 _dispatch_continuation_pop + 534
12 libdispatch.dylib          0x00007fff69234f16 _dispatch_async_redirect_invoke + 703
13 libdispatch.dylib          0x00007fff69241957 _dispatch_root_queue_drain + 326
14 libdispatch.dylib          0x00007fff69242097 _dispatch_worker_thread2 + 92
15 libsystem_pthread.dylib       0x00007fff6948d9f7 _pthread_wqthread + 220
16 libsystem_pthread.dylib       0x00007fff6948cb77 start_wqthread + 15
);
}
--
System Information
macOS Version 10.15.6 (Build 19G2021)
Xcode 12.0 (17218)


This may sound very silly, but one thing that works for me is to unlock the phone BEFORE plugging it in. But sometimes, it seems to be the other way around, where you should unlock AFTER plugging in the phone.

I don't know what the root cause is, I just know doing this usually helps for my case.

I'm on iOS 13.4.1, Xcode 11.7, and had this problem yesterday. Unlocking the phone BEFORE plugging it in fixed the problem.
Thank you boxRabbit! I was getting ready for another wasted day of troubleshooting Xcode issues.
Xcode 11.7 Failed to prepare device for development
 
 
Q