I took my AppleTV to visit relatives, but the TV was far from an Ethernet port, and I didn't have the physical remote. So how to setup Wi-Fi? I dragged the TV next to the router so the AppleTV could be plugged into Ethernet, then I discovered you can't setup an AppleTV for WiFi while it's plugged into Ethernet, but if I unplug the from the network my iPhone's remote app can't control the device long enough to enter a WiFi password.
I could have setup a Bluetooth keyboard, but I hadn't brought one either.
I wondered if I could simulate a Bluetooth keyboard with my phone, but apparently you can't do that in iOS so there is no such app. Then I wondered about simulating a keyboard with my Mac, and there is indeed a keyboard simulator available in the Mac App Store: Type2Phone. Reading the setup documentation is required, but in a few minutes I was sending keystrokes to my AppleTV, and I was able to setup my AppleTV for WiFi.