Sometimes you when you’re updating Xcode, it just hangs in the App Store. Here’s a workaround.
You can download Xcode directly from Apple’s developer website using this link
You can use a free Apple ID if you don’t have a developer account with Apple yet.
Simply delete the old Xcode from your
Applications folder and replace it with the new one you downloaded. Don’t worry, all your settings and projects won’t be deleted.
You’ll need to update your OS. Go into the App Store and click the Updates tab. Update your MacOS to the latest version then try again.