Xcode Installation: how to prevent automatic upgrade of Xcode
Under your Mac's System Preferences there should be a item called App Store where you can turn off automatic updates from App Store (which turns off all app updates, not only Xcode).
The You will be notified when the updates are ready to be installed only applies to the downloading of the data and if you check this box it will therefore download without your explicit approval. It will not install unless you check the Install app updates.
I followed answer by SwiftArchitect to uncheck just 'Install app updates from the App Store' but now you need to go to System Preferences -> Software Update -> Advanced
Beware! Despite the message:
You will be notified when the updates are ready to be installed
in reality:
You will not be notified when the updates are ready to be installed
The notification only applies when Install app updates is not checked. If you select Install app updates, Xcode and all other apps will be silently upgraded. Thus, the answer is:
Do not select Install app updates. This is the only safe way to ensure Xcode does not get upgraded from underneath your feet. This is also the only setup you should pick in a commercial team, where every engineer should have the very same version of the development environment.