Macbook air M2 2023 overheating in xCode

So i found out Xcode running in the backround (while it was closed) causing my macbook to overheat but once i uninstalled the app it came back to normal as per. How can i fix this please i don't wanna send this back for this small bug.

I checked the activity monitor and i could see the Xcode eating 80% of the CPU while it was closed.

this seems to be fixed once I set up the iOS deployment to 16.4 from 17.

How long after installation did this occur ?

AFAIK, Xcode may have to run tasks to complete its configuration. It may take several hours before completing.

Macbook air M2 2023 overheating in xCode
 
 
Q