How to accept Xcode license?
In Terminal:

sudo xcodebuild -license


Which should view/accept it on behalf of all accounts on that particular Mac.

In recent Xcode versions you are able to accept it in one step:

sudo xcodebuild -license accept