Take Control of Your Cellphone: Wireless Screen Mirroring with scrcpy & Tailscale
Using scrcpy & Tailscale and your phone's mobile data — plus one unconventional use I'm building toward.
Project: DIY Thermal Drone (Part 1)
This started as a deep dive into
scrcpy— learning to mirror and control my phone from my PC. But I wanted to push it: fully wireless, over mobile data, with the phone acting as a passthrough for external peripherals.Specifically? A thermal camera dongle.
Can I strap the whole rig to a drone — phone plus thermal dongle — and build a ghetto thermal-imaging drone?
This post covers the remote camera setup: some food for thought up front, then the actual build toward an interesting end product. And because this is a project you'll want to show off, I'm breaking down the CMD OpSec you need first. These commands let you share your progress safely — without doxing your IP or handing the internet full access to your phone.
How I got here
I ran into scrcpy the hard way. Screens die. Sometimes it's a full shatter, pixels barely visible; sometimes it starts as a small fracture and stays usable — until it isn't. And now everything is locked behind 2FA. Even setting up a replacement device: you go to log your accounts back in and hit "please enter the security code we sent to…" — sent to the other phone. The one you're replacing. The one whose screen doesn't work, so you can't see it or tap anything. It buzzes, it dings, a notification lands right then. That's the 2FA code, of course.
OTG got me partway. On some phones you just plug a wired mouse and keyboard into a little USB hub and you can control the phone again — except you still can't see anything.
Keep going down the rabbit hole and you hit scrcpy. How could you not — it's a popular, powerful tool. It mirrors your whole device onto your PC with full control, plus a pile of options: you can tell it to shut off the phone's screen while still mirroring to the PC to save battery, change frame rates, drop quality to cut lag. Really cool program. I wrote about it a while back. This time I'm taking it further, in a more advanced and slightly unconventional direction.
scrcpy lets you control your device, but by default it's still tethered by USB to your PC. It doesn't have to be. This is the fun part — controlling that device wirelessly, from anywhere you have cell coverage. No USB after the first setup, no shared Wi-Fi. We get there by combining scrcpy (screen mirroring) and Tailscale (a zero-config VPN).
Initial housekeeping & privacy (OpSec)
Before we connect anything, a word on privacy. If you're going to share screenshots, stream, or record your setup, a lot of these commands spit out personally identifiable info — IP addresses, computer names, file paths.
Don't dox yourself. Run these in Command Prompt (cmd) to anonymize your session.
1. Anonymize your command prompt
By default CMD shows your full file path, which often includes your real name. The prompt command changes that.
- Drop the path entirely (prompt becomes
>):prompt $G - Linux-style prompt (becomes
$):prompt $$ - Personalize it for your blog:
prompt zkitszo $G
2. Clear the screen (wipe old output)
If CMD is already open with paths showing, changing the prompt doesn't hide the text above it. To wipe the window of anything printed earlier:
cls
3. Hide your profile name in paths
When you reference paths in a tutorial, use a Windows variable instead of typing your actual username. %USERPROFILE% stands in for the computer name.
- Example:
%USERPROFILE%\Downloads\scrcpy\is the universal equivalent ofC:\Users\zkitszo\Downloads\scrcpy\.
4. Advanced: spoof your environment variables
A lot of networking tools automatically grab your PC name or Windows username and stamp it onto logs and output. You can fake these just for that one CMD window.
set USERNAME=Anon
set COMPUTERNAME=Terminal
set USERPROFILE=C:\Users\Anon
5. Advanced: filter entire lines
To hide any line containing a specific word or IP, use the /V switch with findstr. That prints everything except lines matching your secret string.
ipconfig | findstr /V "192.168"
6. Make the anonymous prompt persistent (optional)
Want CMD to load an anonymous prompt every time it opens? Edit the registry. Run this in an Administrator CMD window:
reg add "HKCU\Software\Microsoft\Command Processor" /v AutoRun /t REG_SZ /d "prompt $G" /f
Phase 2: the wireless scrcpy setup
Step 1: Download the resources
On your PC:
- Grab Tailscale for Windows: Tailscale download page.
- Grab scrcpy: scrcpy GitHub releases. Scroll to "Assets," download the
scrcpy-win64-vX.X.X.zip, and extract it.
On your Android phone:
- Grab Tailscale for Android: Google Play.
Step 2: Set up Tailscale
Tailscale builds a secure, private network between your devices — it tricks them into thinking they're on the same local Wi-Fi.
- Install and open Tailscale on your PC. Log in.
- Install and open Tailscale on your phone. Log in with the exact same account.
- In the phone's Tailscale app, note the IP at the top (usually starts with
100.x.x.x). Write it down.
Step 3: Enable developer mode & USB debugging
- Go to Settings > About Phone.
- Find the Build Number and tap it 7 times fast to unlock Developer options.
- Back in Settings, open Developer Options and turn on USB Debugging.
Step 4: The one-time USB handshake
You need a USB cable just for this first handshake.
- Connect the phone to your PC with USB. If prompted, tap "Allow USB debugging."
- Open the folder where you extracted scrcpy.
- In the folder's address bar, type
cmdand press Enter to open a command prompt in that directory. - Run:
adb tcpip 5555
Once that finishes, unplug the USB cable. Leave the command prompt open.
Step 5: Connect wirelessly over Tailscale
Now connect the PC to the phone using the Tailscale IP you wrote down. Type adb connect, your phone's Tailscale IP, and :5555 on the end.
adb connect 100.x.x.x:5555
Step 6: Launch scrcpy (tuned for lag)
Since you're streaming over mobile data, the defaults will stutter. Lower the bitrate, drop the resolution, and cap the framerate:
scrcpy --video-bit-rate=2M --max-size=800 --max-fps=30
A window pops up with your phone screen. You're now controlling the device over mobile data.
The next chapter
Part 1, done — phone data, scrcpy, and Tailscale giving you full access to your device from almost anywhere there's coverage.
Next, I'll take all of this and apply it to the ghetto thermal drone. I already have the thermal dongle, my current phone, and a small drone.
I'll cover the full setup, flight testing, and probably troubleshooting a few concerns I've already spotted. I'll also dig into specific hardware and cellphone options to see how small and light a phone I can get that still works with the thermal dongle. All that and more in Part 2.
I'll post the link here once Part 2 is up. If you've seen it live and I forgot to link it, let me know. And if you learned something, shared it, or know an easier way to pull this off — tell me.
Comments
Post a Comment