There are multiple solutions for this:
Solution 1: Patiently wait for 10 to 15 minutes. Have a tea or roam around 😉
Solution 2: Disconnect device from the system. Restart both iPhone and Xcode and then rebuild again.
Solution 3:
- Go to Windows → Devices and Simulators (Shortcut key: cmd+shift+2)
- You’ll see iPhone device connected to system with messageiPhone is busy: Preparing debugger support for iPhone
- Click on plus button (+) present in bottom-left corner.
- This will show the device connected to system. Click on Next button.
- Thereafter you’ll see ‘device setup was successful’. Click on Done button.
Solution 3 worked for me!