I did these steps:
sudo xcode-select -switch /Applications/Xcode-beta.app/
In terminal, you should first input the commands below
cd /Library/Developer/CommandLineTools/Packages open .
cd /Library/Developer/CommandLineTools/Packages
open .
you will open the directory on desktop, then double click the pkg file to install it.