Episode: 3515 Title: HPR3515: ADB and scrcpy Source: https://hub.hackerpublicradio.org/ccdn.php?filename=/eps/hpr3515/hpr3515.mp3 Transcribed: 2025-10-25 00:49:30 --- This is Hacker Public Radio episode 3515 for Friday 21st of January 2022, today's show is entitled ADB under CRCBY, it is posted by Ken Fallon and is about 9 minutes long and carries a clean flag. The summary is some useful tools for working with Android devices. Hi everybody, my name is Ken Fallon and you're listening to another episode of Hacker Public Radio. Today I want to talk to you about Android debugging, specifically the Android Debug Bridge, which is commonly known as ADB, link for where you can get that in the show notes. So this is basically a tool that allows you to control your Android phone via the command line. So to install it there are multiple guides online, but I found that DNF install Android dash tools and ADB dash enhanced was the easiest for me. Your mileage may vary on your packet manager, search for ADB alpha delta bravo and there's a link in the show notes to XDA developers advice on how to install it. And in order to use the functionality of this you're going to need to enable the developer mode on your phone. It's not as complicated as doing something like trying to root your phone, it should be available on most phones. So if you go to settings, so usually if you pull down from the top twice you should see a Cug icon and if you search for the string build space number you should find it's usually in about phone section. And then you want to look for build number and once you find build number tap it seven times. So tap tap tap tap tap tap tap tap and once you've done that seven times you will become a developer. So press the back key and then you will see a hidden menu called developer options has become available. If you can't see it you should search for it. It's usually in the system section. And in there you're going to need to turn on two things. So one is Android debugging and the other one is ADB over network. So I'm aware in the settings area if you don't know what the IP address of your phone is, it's a good idea to search for IP space address. It's probably in the about phone section and you should see your IP for address so make note of that for later. So once you have the tools installed and you've got developer options enabled you have essentially everything that you need to communicate from your computer to your phone. So if you type ADB space help you'll get more information. There's no man page for some reason on the options that I have but any who. It is divided down to several sections that local section tells you how to connect to your phone. The general section shows you. Show your devices and how to get help. The networking section allows you to connect over the network and also to do stuff like port forwarding and reverse port forwarding. The file transfer section shows you how to reliably get form files over and back from reform. It's the only one that I only method of transfer that I've actually found is reliable on Android and then you have internal debugging section which tells you how to start and stop the Android server Android debugging server. So we're going to connect in two ways in this section one is via usb. So if you plug in your phone first thing you'll hear is a donk. It's telling you that you've connected up a phone but it will also the first time put up a pop-up notification to give permissions. So if you approve that you should be good to go and then your phone will just sit there. But if you open up a terminal and type ADB space shell you should see that you're now in your phone and you can do all sorts of cool stuff like CDLS find. So for example if you go find storage self primary that's where probably all your files are located. And in there you can delete files, you can create files, you can copy text from your console into a file over there. So unfortunately if you unplug your phone you will no longer have a connection to it so you can also enable network access via TCP. So leave your phone connected into usb for a minute and then we need to tell us to use the TCP command and you can do that by typing out of the shell typing ADB space TCP IP space 5555. So that will enable, that will tell the phone to go ahead and listen over TCP connection for incoming USB debugging which is what we turned on earlier. Sorry over the network ADB debugging over the network. So you can then connect your phone using an IP address and port 5555. So disconnect your USB at this point and then go ADB space connect space and your IP address and port number. So my example 192168.1.100 call on 5555 and you should get something like connected to the IP address port number. So that's it. And again commands like ADB space shell will allow you to access the phone even if it's not physically connected via USB. So everything is good to go there but say you have two phones or a tablet and a form 200 devices you want to control both them. You can do that using multiple devices. So the only issues you need to be able to identify which phone is which and to do that you can go ADB space devices space dash L for listing. And actually if you do that and you got your phone connected you'll see an IP address if it's over the network and you just see a serial number if it's the phone itself. But in either case you'll see product is the name of your phone and devices the name of your phone. So that's useful information but the important thing to remember or take away from this is the transport underscore ID. And that's the one that we can use later with the ADB command itself and the dash T option which is allocate a PTY if a TTY if on a TTY. No idea what that means but what it means is it tells us which of the connections that you want to use dash T will tell so tells it whether you want to go to transport ID 9 in my case. Is one phone or 14 in my case is another phone or equally it could be one which might be USB. So for example ADB space dash T space 14 space shell will connect to the second phone in my example. So that is that's how you can remote control to your phone so you can leave the phones in a different location and you can be somewhere else and just monitoring coming SMSes and stuff like that on your phone. While it's somewhere else it's handy for us we have a shared phone so for the house so it's nice to be able to see what's going on the phone from down here. One other thing that you might want to be able to do is use remote screen sharing and for that does it absolutely excellent to call SCRC PY screen copy. And from Wikipedia that is it's a free and open source screen monitoring application to allow control of Android devices and the source code is available on GitHub. So you can install those using app to install SCRC PY but then for the way you need to enable a corporate pose Zeno and the link is in the show notes and then you can do a DNF install. And with only one phone connected you can just use it as is and then your phone will appear in front of you like the NC session or remote desktop session. But if you want to connect over TCP IP if you want to identify a phone targeted you can do SCRC PY space dash dash TCP IP equals IP address call import. And then once you do that you can make a connection to bolt your phones like I have in the example. There's loads that you could say about SCRC PY screen copy I guess and it does really deserve a show itself. You can do all sorts of screen recording and stuff like that so it's kind of handy. One thing to remember is that if you right click that's the power button and your finger is essentially the mouse. If you go to the website it gets hot page then you'll find more information about that their control and drag is screen pinching and all that sort of good stuff that I don't tend to do anyway. But as a way of having that the phones on your desk it's a really really cool thing. Okay folks that's it thank you very much for listening hope you got something of interest from this show. And tune in tomorrow for another exciting episode of Hacker Public Radio. You've been listening to Hacker Public Radio at HackerPublicRadio.org. Today's show was contributed by an HBR listener like yourself. If you ever thought of recording a podcast then click on our contributing to find out how easy it really is. Hosting for HBR is kindly provided by an honesthost.com. The internet archive and our sync.net. Unless otherwise stated today's show is released under Creative Commons, Attribution, ShareLike, Feed us all lessons.