To run the template on the actual device, follow these steps:
Open the Xcode settings through Xcode at the top menu bar and then click on Preferences….
Navigate to Accounts.
Click on the plus icon to add a new account.
Select Add Apple ID… from the menu.
Enter the required credentials and confirm by clicking on Add.
Connect your device to your Mac.
Open the Xcode organizer by going to Window | Organizer to check whether the device has been successfully detected.
Select the device from the menu by clicking on the application name and selecting the correct device.
Run the project by hitting the play button.