Installing XCode

1- Download XCode

If you do not have a real Mac OS computer, you can install an virtual  Mac OS operating system running on VMWare (Or VirtualBox), this is a feasible way to get Mac OS operating system, and can install XCode. You can see the instructions at:
Please notice that the XCode version depends on the version of the Mac operating system, so make sure that your Mac operating system is the latest version, if not, during the installing process you will receive an error notification shown below:
It is completely free to upgrade the version of the Mac operating system. To have a better experience, I highly recommend you to upgrade it.
In case you do not want to upgrade the operating system but you still desire to install XCode, please download the appropriate version, knowing that it may not be the latest version.
XCode Minimum Mac OS Version
XCode 11.4.1 macOS Catalina 10.15.4
XCode 11.4 macOS Catalina 10.15.2
XCode 11.3.1
XCode 11.3
XCode 11.2.1 macOS Catalina 10.15
XCode 11.2
XCode 11.1
XCode 11
   
XCode 10.3 macOS 10.14.6
XCode 10.2 macOS 10.14.4
XCode 10.1 macOS 10.14.1
XCode 10 macOS 10.14
   
XCode 9.x macOS 10.13.2
   
XCode 8.x macOS 10.12
   
XCode 7.x OS X 10.11
You access to the link below to download Xcode:
Then select the XCode version that matches your operating system version.
After downloading successfully, you will get an XIP file (A  MacOS compressed format), or a DMG file (A format to be installed in  MacOS).
XIP is a compressed format of MacOS. Like  ZIP, it consists of a digital signature which protects the integrity and the original information of the file.

2- Installing XCode (XIP)

In  XCode 8.x or later version, after downloading it, you will receive an XIP file. Next, move it to another folder of yours (Except for the Downloads folder).
Then double click on it to open.  MacOS Archive Utility will check the digital signature and extract this file.
After that, double click on Xcode to install it.
Wait until the installation is complete, then it is ready to kickstart.

3- Installing XCode (DMG)

In  XCode 7.x or older version, the installer is a DMG file, so you double click on the file to install it.
Waiting until the copy process has completed.
After installing and copying Xcode to  Application, you need to install it.
Click the drive icon on the screen.
Open Application folder:
Click to Xcode icon to install.
That's OK, all are already, you can start a XCode Project.