In order to code sign your app, each target in your Xcode project must be assigned to the same team. If you enroll as an individual, you’re considered a one-person team. If you are not a member of the Apple Developer Program, Xcode will create a personal team for you.
In the project editor, select the target from the Project/Target pop-up menu.
Note: A target has different settings than a project.
Click Signing & Capabilities.
If necessary, click the disclosure triangle next to Signing to reveal the settings.
Under Signing, select "Automatically manage signing”.
Choose your team from the Team pop-up menu.
If the Add Account button appears next to Team, click it to add your Apple ID account in Accounts preferences, then select the account from the Team pop-up menu.