Xcode automatic signing failed on M1 Mac

I'm trying to debug my iOS app which designed only for iPhone on a M1 mac. But I got the error about signing. Xcode automatic signing failed with the note below:
"Xcode failed to provision this target. Please file a bug report at <https://feedbackXx> and include the Update Signing report from the Report navigator."
"Provisioning profile "iOS Team Provisioning Profile: com.XX" doesn't include the currently selected device "XX的MacBook Pro" (identifier XX)."
How can I fixe it?
I have the exact same issue. Been searching everywhere and nothing seems to work. Tried using manual signing but I cannot even add my Mac into the profile, it fails.

Are you maybe running Xcode in Rosetta mode? I had this issue, exactly as mentioned above. To fix this I closed Xcode, turned off Rosetta and it's now working as expected. However, this might be a different issue but this might help some people.

Xcode automatic signing failed on M1 Mac
 
 
Q