Mac / XCode issue while connecting to the iPhone

I have been struggling with debugging on device from two weeks on my office Mac. When I connect any of my devices to the Mac, it does not appear at all on XCode. On some ocassions it is detected by Finder, then prompted to trust the device. After that it either keeps “Loading…” forever or presents a pairing error, but the iphone is never accessed from Finder or Xcode. 

Console App outputs this information: 

por omisión	15:36:27.666976+0200	kernel	026954.656258 adb@(null): AppleUSBHostUserClient::start: missing entitlement com.apple.appledfr.client
por omisión	15:36:28.754513+0200	kernel	026955.743773 adb@(null): AppleUSBHostUserClient::start: missing entitlement com.apple.appledfr.client
por omisión	15:36:29.834747+0200	kernel	026956.823984 adb@(null): AppleUSBHostUserClient::start: missing entitlement com.apple.appledfr.client
por omisión	15:36:30.918818+0200	kernel	026957.908033 adb@(null): AppleUSBHostUserClient::start: missing entitlement com.apple.appledfr.client
por omisión	15:36:31.997785+0200	kernel	026958.986978 adb@(null): AppleUSBHostUserClient::start: missing entitlement com.apple.appledfr.client
por omisión	15:36:33.072568+0200	kernel	026960.061738 adb@(null): AppleUSBHostUserClient::start: missing entitlement com.apple.appledfr.client
por omisión	15:36:34.154567+0200	kernel	026961.143714 adb@(null): AppleUSBHostUserClient::start: missing entitlement com.apple.appledfr.client
por omisión	15:36:35.243197+0200	kernel	026962.232322 adb@(null): AppleUSBHostUserClient::start: missing entitlement com.apple.appledfr.client
por omisión	15:36:36.339062+0200	kernel	026963.328165 adb@(null): AppleUSBHostUserClient::start: missing entitlement com.apple.appledfr.client
por omisión	15:36:36.611157+0200	usbmuxd	_AMDeviceInsecureNotificationCallback (thread 0x700001de2000): AMDeviceStartSession() failed: 0xe8000003
por omisión	15:36:37.418613+0200	kernel	026964.407697 adb@(null): AppleUSBHostUserClient::start: missing entitlement com.apple.appledfr.client
por omisión	15:36:56.606856+0200	Safari	_connect_to_port (thread 0x700006d8a000): USBMuxConnectByPort failed to connect to the device 00008101-000559493642001E on port 32498: Operation timed out
por omisión	15:37:36.947782+0200	kernel	027023.935659 Google Chrome@(null): AppleUSBHostUserClient::openGated: could not open provider USB3.0 Hub. provider already opened for exclusive access by a kernel client
por omisión	15:37:37.048259+0200	kernel	027024.036125 AppleUSB20HubPort@14210000: AppleUSBHostPort::enumerateDeviceComplete_block_invoke: enumerated 0x05e3/0610/9226 (USB2.0 Hub)
por omisión	15:37:01.623795+0200	Xcode	[MT] iPhoneConnect: 📱<DVTiOSDevice (0x7fed3ab95950), iPhone 12 CIRA, iPhone, 14.5 (18E199), 00008101-000559493642001E> -- An error occurred whilst preparing device for development -- 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.";
}
--
This device is no longer connected.
Domain: com.apple.dt.MobileDeviceErrorDomain
Code: -402653052
User Info: {
  DVTRadarComponentKey = 261622;
  MobileDeviceErrorCode = "(0xE8000084)";
  "com.apple.dtdevicekit.stacktrace" = (
	0  DTDeviceKitBase           0x0000000123ed43b8 DTDKCreateNSErrorFromAMDErrorCode + 220
	1  DTD
por omisión	15:37:01.623970+0200	Xcode	[MT] iPhoneConnect: 📱<DVTiOSDevice (0x7fed3ab95950), iPhone 12 CIRA, iPhone, 14.5 (18E199), 00008101-000559493642001E> == Underlying device preparation errors ==
por omisión	15:37:01.624192+0200	Xcode	[MT] iPhoneConnect: 📱<DVTiOSDevice (0x7fed3ab95950), iPhone 12 CIRA, iPhone, 14.5 (18E199), 00008101-000559493642001E> == END: Underlying device preparation errors ==

The device is an iPhone 12 with iOS 14.5 but I have tried with an iPhone SE 2020 running 14.6 and my personal device, iPhone 11 Pro with 14.6, none of them detected by the computer that fails to connect this device, which is a Macbook Pro 16 inches running Big Sur 11.4 and some company’s MDM, anti virus and policies. IT guys state they did not update any policy for this particular issue or any update beyond OS X 11.4 and apparently there are more Mac affected by this (either not connecting iPhones or not connecting USB peripherals at all). We had one Macbook with features close to mine running Catalina and it seems it is not affected at all. Also I have tried these particular iPhones on my personal Macbook Pro 2017 (same XCode and OS X version) and they just work fine. 

I have reinstalled XCode and reinstalled OSX but the problem keeps going. Does it ring any bell to anyone? I am pretty desperate as I cannot debug on device at all! Thank you

Answered by rextremotabaresDT in 678972022

Apparently there was an issue with the miriad of antivirus and MDM software installed in the device that prevented the device connection from OS X 11.4. When the antivirus was uninstalled from the machine it started working perfectly, so it was not XCode or Apple related.

Check your connector. Look in the bottom of the iPhone, try using a toothpick to see if there is lint caught in there (happens a LOT). If not, then check the cable. Do the connectors look warn? The lightening end of the cable will wear out eventually (about every 18 months for me). Try another cable.

Accepted Answer

Apparently there was an issue with the miriad of antivirus and MDM software installed in the device that prevented the device connection from OS X 11.4. When the antivirus was uninstalled from the machine it started working perfectly, so it was not XCode or Apple related.

Mac / XCode issue while connecting to the iPhone
 
 
Q