Setup from iPhone
Scan the code on the TV, fill in the source on your phone, and the Apple TV gets it.
On Apple TV with an iPhone, iPad or Mac.

Scan the code on the TV
The Apple TV shows a code. Scan it with the iPhone camera, or accept Handoff, and Antuna opens on the phone ready to set up the TV.
Apple TV with an iPhone, iPad or Mac on the same iCloud account.
Type on the phone
Fill in the source with the phone's keyboard and the Apple TV receives it through your iCloud.
Apple TV with an iPhone, iPad or Mac.
Send a login to the TV
When an Apple TV needs a password, send it from the phone. It is sealed so only that Apple TV can read it, travels through your own iCloud and is deleted within ten minutes.
For Xtream, Stalker, Jellyfin and Channels DVR sources.
No Antuna on the phone yet
A phone without Antuna that scans the code gets a plain page with a link to the App Store.
On iPhone.