Creating a second-Apple ID with 2FA
Much of what you should do to create an iOS app isn’t entirely made clear which is unfortunate. Despite issues with Apple’s documentation they are starting to make head way for new beginners with things such as the Scrumdinger tutorial which is about a 4 hour tutorial covering developing Apps with SwiftUI.
But one thing that should be very straight forward and isn’t, is creating a second Apple ID for the developer program. Something you should do to separate your personal stuff from your developer things.
Searching Google comes up with tons of less than ideal solutions. But Kyle Seth Grey provides the most straight forward sane solution to creating a second Apple ID.
Basically create the the account in the Apple ID website, then go into settings -> Mail and add a new iCloud account syncs absolutely nothing.
The one thing I would add to this is if you have an existing project you might find that even after you add the account to Xcode it still fails to transfer over, erroring on provisioning details.
This is easily fixed. With your new second apple id added and loaded into Xcode, create a new project and build it. That will almost certainly be successful and behind the scenes everything is setup so you can then open the existing project then change Team and possibly bundle identifier in the ‘signing & capabilities’ section.
That is everything you should need to create a developer account for iOS developer.