Xcode build hanging the device.

When I test my apps on my device both iPhone 11 Pro and iPhone 13 Pro Max through Xcode build, the device gets bricked. Even force power off won't work, only thing working will be control panel of the device where I can turn Cellular Data and Torch to drain battery faster. The device only work after shutdown through complete battery drainage and restarting after recharge. Anyone else facing this issue?