The Apple ID I use for my developer account is separate from my personal Apple ID. All my devices are signed in with my personal Apple ID.
I was trying to set up Xcode on my machine, and when I went to sign in to my developer account, it told me I had to set up Two-factor authentication.
Upon going to the Apple website to do so, however, it told me I had to be logged in to the account from an iOS or macOS device to set it up, which I am not. So how can I use Two-factor authentication (presumably via a trusted phone number) with my developer Apple ID without being logged in to that Apple ID on a iOS/macOS device?
Best Answer
The linked MacRumors article discusses your exact concern and solution in detail:
The solution to the problem requires you to login with your developer user account on a trusted device. This can be done by creating a new/temporary user account on a Mac, logging into iCloud with your developer Apple ID, activate Two-factor authentication when asked to and entering a phone number to receive text messages.
You can then proceed to setup an iOS device to receive verification codes without enabling other iCloud features. Go to Settings app → Passwords & Accounts and add a new iCloud account. After authenticating successfully, choose not to enable any of the iCloud features and save the account.
This way you can have a trusted device setup to receive Two-factor authentication codes without logging out of your primary iCloud account on your device.