To test your build on an iOS device, you need a free Apple ID. However, to use services such as Game Center or In-App Purchases, and to submit your game to the App Store, you must register with the Apple Developer Program. For more information about the differences between an Apple ID and Apple Developer Program membership, see the Apple support documentation on Choosing a Membership.
Xcode is an Apple-developed, Mac-only integrated development environment (IDE) that contains a suite of software development tools. You can use Xcode to create software for the macOS, iOS, WatchOS, and tvOS.
Download Xcode from the App Store.
To add your Apple ID to Xcode, follow the steps outlined in Apple’s documentation on Adding an Apple ID account to Xcode.