For some reason, this didn't work on my old phone after installing PixelExperience 11 on it.
There's a third way. Bluetooth. At least you don't need a cable, and you'll save power.
For that reason, I usually use Bluetooth instead of Wi-Fi, unless I need higher bandwidth (except during peak hours of network usage, when my connection speed is below 1Mbps anyway).