We use to be able to run the xcrun altool all the time to upload apps to Test flight, but now it has been failing consistently for the last few days.
For example:
xcrun altool --list-providers -u myemail@email.com
then I add my password and get the following error.
*** Error: Failed to list providers.
*** Error: Failed to list providers. Failed to get authorization for username 'myemail@email.com' and password. (
"Error Domain=NSCocoaErrorDomain Code=0 \"Status code: 0\" UserInfo={NSLocalizedDescription=Status code: 0, NSLocalizedFailureReason=The auth server returned a bad status code.}"
) (-1011)
I have tried to run it on different networks and even had others on my team try and they get the same error.
This was working for a long time (even a few times with Xcode 13) and now it just stopped
It was due to 2 factor auth. See here https://stackoverflow.com/questions/56436345/how-to-upload-to-app-store-from-command-line-with-xcode-11
If your apple account use TWO-FACTOR Authentication , your password would be wrong , you need to go to https://appleid.apple.com/account/manage "Security - Generate Password" to get the password