The HTC One smartphone came with a programmable IR port. All you had to do was determine the TV brand (easy if you can see it), then point the top of the phone at the TV pushing the "power" button until it went off. Then you knew you had the right configuration.
I mostly used it for turning volume down in waiting rooms or at bars, but a bar was also where I figured out most of their TVs tend to be set to the same control because they had a few with their sensors in a line where I was sitting and they all went off together while I was programming it.
One of the phone features I miss most, after the 3.5mm jack. Nobody needs to hear loud daytime TV in a waiting room.
My work Samsung phone also came with IR port and an app.
Third party app. Un-uninstallable
That Samsung apparently didn't pay enough coz after 3 years I had taskbar ads from that app that couldn't be removed.
N900 had one too, along with an FM transmitter, just in case you wanted to override whatever generic radio station was playing at full volume in the coffee shop
Just got a new OnePlus 15 last month and it has an IR blaster built in. Works great
My current phone is a (Xiaomi) POCO M4 Pro. It has both an IR port and a 3.5mm jack. It's a great device, although it doesn't support 5G.
Sometimes, when the remote is too far, I control my TV with it.
I would be shocked if this doesn’t exist as a small dongle you could plug into your phone directly or operate wirelessly. If you’re someone who already has a few pieces of EDC, maybe it could be stashed on a keychain.
In the 90s, my HP-48G graphing calculator had the same, and someone wrote a free universal remote control app for it.
I had way too much fun screwing with the TVs at school.
Ages ago I built a tv-b-gone, and hid it inside an old car key fob. I'd carry it most places, turning off TVs as I went.
Nowadays I just use my flipper to do much the same