I found a new way to solve this problem.
You don't have to logout any accounts on XCode.
Just create a new user of your macos and login to the new user which you created.
then open xcode, login to the developer account which you cannot login in before.