How to update XCode with a different userid?

So i have been given a macbook by my employer which was used by previous developer for iOS development. Now Appstore is asking me to update XCode to new version and when I am trying to update , it keeps asking me to login using Apple ID. In pop up window, it keeps showing me old user's apple id and doesn't let me change also. It is frustrating that Apple doesn't allow a different user to update the software unless that user has installed it. Any solution for this problem?

I came across https://stackoverflow.com/questions/10395077/updating-xcode-using-different-apple-account this. The solution here says to delete the XCode from launchpad and then reinstall it. My question is if I delete XCode , will it affect existing iOS project files which were created using XCode?


Solution 1:

Delete the app from /Applications and then re-download it from your preferred Apple ID. Launchpad deletion is a bit cleaner, but does the same thing, preserving user files created by Xcode, but deleting the application itself.

Unless you stored project files in /Applications, you won't affect project files or user settings since they get stored by default in /Users

Solution 2:

To make the AppStore forget the old credentials with which the app was downloaded, you must remove the _MASReceipt directory in the XCode app package itself.

  • Open Finder and navigate to Applications
  • Ctrl+Click XCode and choose "Show Package Contents"
  • Expand the Contents directory and click _MASReceipt to select it
  • Press Cmd+Delete to delete the directory permanently—you will be prompted for your credentials since this is a protected file.
  • Quit and restart AppStore.

From https://stackoverflow.com/a/13613340/81234.