I get "Failed to prepare device for development." on my iPhone for development

When I go to Windows->"Devices and Simulators".

I get:

"Failed to prepare device for development."

"If you are certain that Xcode supports development on this device, try disconnecting and reconnecting the device."

I, of course, tried disconnecting and reconnecting, with no change.

My iPhone is iPhone 12 Pro with 14.3 (18C66)

My xCode is Version 12.3 (12C33)




I've had the same problem with iOS 14.4 (18D5030e)

The remote device connection terminated with an error.
Domain: com.apple.dtdevicekit
Code: 802
Failure Reason: The device finished with the error code -402653083 ("Could not connect to the device.").
Recovery Suggestion: Please check your connection to your device.
User Info: {
  DVTDeviceErrorIsProxied = 1;
  DVTRadarComponentKey = 487927;
}
  • -

Could not connect to the device.
Domain: com.apple.dt.MobileDeviceErrorDomain
Code: -402653083
User Info: {
  DVTRadarComponentKey = 261622;
  MobileDeviceErrorCode = "(0xE8000065)";
  "com.apple.dtdevicekit.stacktrace" = (
0  DTDeviceKitBase           0x000000012f0aac8f DTDKCreateNSErrorFromAMDErrorCode + 220
1  DTDeviceKitBase           0x000000012f0c0f96 -[DTDKCopyValueRequest finishWithResult:andError:] + 490
2  DTDeviceKitBase           0x000000012f0bc67b _60-[DTDKRemoteDeviceConnection primitiveDrainPendingRequests]blockinvoke3 + 213
3  DVTFoundation            0x000000010ffa117e DVT
CALLINGCLIENTBLOCK + 7
4  DVTFoundation            0x000000010ffa2da0 _DVTDispatchAsyncblockinvoke + 1191
5  libdispatch.dylib          0x00007fff201ed5dd
dispatchcallblockandrelease + 12
6  libdispatch.dylib          0x00007fff201ee7c7 dispatchclientcallout + 8
7  libdispatch.dylib          0x00007fff201f1195
dispatchcontinuationpop + 423
8  libdispatch.dylib          0x00007fff201f0868 dispatchasyncredirectinvoke + 713
9  libdispatch.dylib          0x00007fff201fd857 dispatchrootqueuedrain + 326
10 libdispatch.dylib          0x00007fff201fdfb8 dispatchworkerthread2 + 92
11 libsystem
pthread.dylib       0x00007fff20396453 pthreadwqthread + 244
12 libsystempthread.dylib       0x00007fff20395467 startwqthread + 15
);
}
  • -


System Information

macOS Version 11.2 (Build 20D5029f)
Xcode 12.3 (17715) (Build 12C33)
Timestamp: 2021-01-09T15:19:40Z
Same on iphone 12 pro max, reconnecting and restarting made no difference.
Restarting my iPhone fixed this right away for me.
iOS 14.4 (18D52)

System Information
macOS Version 11.2.1 (Build 20D74)
Xcode 12.4 (17801) (Build 12D4e)

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.";

}
Same happened to me with an iPhone 12 Pro Max with iOS14.4 installed along with Xcode 12.4.

The only solution that worked for me was restarting the iPhone.
I've just opened a bug report FB9019586
I had the same issue with my iPhone 12 Pro Max with iOS 14.4.1 installed along with Xcode 12.4
Restarting my phone solved the issue for me.

~~Hmm. Seems like I had to go into Keychain Access > Certificates > Apple Worldwide Developer Relations Certificate Authority for one expiring in 2030 & change Trust to System Default. It was set to Always, and this fixed my issue. ~~

Oh, seems I'm running 14.6 and 11.4, and the current version of Xcode only supports up to 14.5 and macOS 11.3. Welp, issue identified.

Restarting my iPhone 12 Pro also worked for me

I'm running iOS 15.1 (19B74) on an iPhone 13 Pro Max., and XCode 13.1

I was having this problem. Taking a hint from an answer above (in this thread), I checked KeyChain Access -> Certificates and I found duplicated Apple Worldwide Developer Relations Certificate Authority, one expiring in 2023, and another expiring in 2030. I deleted the 2023 one. I also saw some expired developer certificates/authorities, and got rid of those.

I double clicked a few of the certs I know I trust and set the trust dropdown selection from "Use system defaults" to "trust".

All that resolved it. Maybe that entailed more than I needed to to resolve it, but it works now.

Restarting my iPhone fixed this right away for me. IOS 15.1

Restarting the iPhone worked for me

iOS 15.4 and xcode version 13 in Devices shows Unable to prepare device for development, still not working after rebooting the iphone and xcode

I have the same problem with my iPad Pro and iPhone 13 (iOS 15.4) and Xcode 13.0. Multiple reboots failed to solve the problem. I even revoked and reissued my Developer Certificate. No joy. Help!

Encountered same problem using Xcode 13.1 and an iPad Pro iOS 15.4 (just installed). Updating to Xcode 13.3 solved the problem for me.

note : The update took 2 hours for me. Use Activity Monitor to find the PID for installd, then use 'caffeinate -s -d -w ' to keep system and display up until the installd process finishes.

I had this problem with the latest XCode 13.3.1. iPhone restart helped

I get "Failed to prepare device for development." on my iPhone for development
 
 
Q