Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to main content

Get the Reddit app

Scan this QR code to download the app now
Or check it out in the app stores
r/Android icon
r/Android icon
Go to Android
r/Android

Android news, reviews, tips, and discussions about rooting, tutorials, and apps. General discussion about devices is welcome. Please direct technical support, upgrade questions, buy/sell, app recommendations, and carrier-related issues to other subreddits.


Members Online

What are some of the coolest things you can do with ADB?

Hey guys, just installed ADB on my OnePlus 7 Pro 5G, what are some of the nicest things you can do to it customisation wise?

Thanks!

Archived post. New comments cannot be posted and votes cannot be cast.
Share
Sort by:
Best
Open comment sort options
u/LitheBeep avatar

Scrcpy - it's a program that uses ADB to mirror your phone screen on your computer. Full control.

I second this, but from an embedded android development perspective; device with no screen (IOT for example).

u/rtyuuytr avatar

Supports wireless scrcpy also. Can be completely wireless with root. Requires USB to connect for setup initially without root.

[deleted]
[deleted]

Comment deleted by user

u/ClearFaun avatar

I tried to do it and it looked really complicated. How long did it take to set up?

More replies

Could you use it as a second screen too?

u/LitheBeep avatar

Like as a second screen for your PC? I don't think so. But there are plenty of apps that do that anyway.

u/cheesegoat avatar

What's a good app to use it as a pc second screen?

u/LitheBeep avatar

duet display and spacedesk are the two I know of

More replies
More replies
More replies

It lags a lot on the phones native resolution for me.

I have to lower it and the bitrate a lot for it to be smooth. Which makes it look hideous.

u/DjGamewon avatar

What phone do you have? It runs completely fine on my Huawei P10 running Android 9 both by USB and WiFi

oneplus 7 with android 10. Could it be depended on the wifi internet speed? I have like 10mb/s through wifi.

u/DjGamewon avatar

Is that speed LAN or to internet? Because I don't think there should be any problems for any router to handle scrcpy.

More replies
More replies
More replies
More replies
u/lunar_unit avatar

Manufacturer bloatware removal with ADB.

This article is three years old, but some of it still applies.

u/LBHJ1707 avatar

Oh shit thats awesome! Thank you.

u/AD-LB avatar

Here's another tutorial, if you prefer to have an app to help you on this.

More replies

I just did this and this is so freeing. I'm not even techy, it is so surprising how easy it is

More replies
[deleted]
[deleted]

You can remove pre-installed bloatware that can't be disabled / uninstalled using the standard phone methods.

https://www.xda-developers.com/uninstall-carrier-oem-bloatware-without-root-access/

u/testube_babies avatar

ADB is a tool for debugging. It can be useful but not sure I would qualify any of its uses as "cool". These are some of the most common operations:

adb shell - launches a shell on the device

adb push <local> <remote> - pushes the file <local> to <remote>

adb pull <remote> [<local>] - pulls the file <remote> to <local>. If <local> isn’t specified, it will pull to the current folder.

adb logcat - allows you to view the device log in real-time

adb install <file> - installs the given .apk file to your device

u/_meegoo_ avatar

Also, adb push/pull is faster than transfering through MTP. Even more so if you are transfering a lot of small files.

[deleted]
[deleted]

Comment deleted by user

Yes. I remember backing up my WhatsApp directory. It's full of pictures, memes, etc, and would take 2 hours via MTP. I did an ADB pull and it finished within 5 minutes.

By mtp do you guys mean using a file browser to access the phone's internal storage or does adb have some sort of mtp thing?

By MTP I mean setting it on MTP mode, and then browsing on your computer via Windows Explorer.

I've noticed Mac's file browser is pretty fast though even if it is operating in MTP mode. I recall copying over a folder like WhatsApp and preparing for an hours long operation which turned out to be minutes. I think Windows MTP is just bad....

More replies
More replies
u/Ashanmaril avatar

Sometimes I have to because Windows' file explorer randomly disconnects my device or something. It also takes forever to display a folder with lots of files

[deleted]
[deleted]

Comment deleted by user

As much as I don't like Windows, MTP on Linux is just as bad.

u/Tonybishnoi avatar

Oh my god, I cannot describe in words how painful MTP is and there are no good wireless file transfer programs between PC and Android, Ever since Google removed the mass storage USB mode, file transfer is a pain.

This comment is a godsend! Thank you so much.

I was once transferring a 2.5GB folder with lots of subfolders and smaller files and it took HOURS.

More replies
u/LBHJ1707 avatar

Ah, thank you! I was saying coolest because I saw stuff using it for example removing the top taskbar which I did purely to stop burn in and it also looks pretty sweet. I was wondering if there was other stuff like it lol

[deleted]
[deleted]

Be aware that ADB push/pull doesn't transfer the timestamp of files by default. I have a ton of photos now that have all the same timestamp now, which messed up gallery view. I don't know the exact command but you have to add a command to the push/pull command for it to also write timestamps. Because of quirks like these, I keep my hands off of ADB push/pull.

u/fx599 avatar
[deleted]
[deleted]

LEGEND! The app you've linked is limited in its free version, so I used https://play.google.com/store/apps/details?id=com.exiftool.free which worked marvellously. Thanks a ton, man!

More replies
More replies

Of course if we limit ourselves to the intended uses, ADB is just a debugging tool and not particularly interesting. The trick is to use ADB's capabilities in unintended ways to do cool shit like scrcpy

u/AD-LB avatar

Is it possible to get the device's IP via adb?

Could be useful to use adb-over-wifi.

u/testube_babies avatar

With "adb shell" you can run commands. "ifconfig", "netcfg", or an "ip" command would get you to an IP address.

u/AD-LB avatar

Using "ifconfig" worked, but I had to find the IP after wlan0 Link encap:UNSPEC Driver icnss inet addr: .

Using "netcfg" didn't work , and using "ip" showed I need to specify some parameters.

u/Iguanzor avatar

if you only need the ip address issue this command

adb shell ip a | awk '/wlan0/ {a=$2} END{print a}'

if you don't use linux just issue the adb shell command and then enter the rest of the stuff

u/AD-LB avatar

"if you don't use linux just issue the adb shell command and then enter the rest of the stuff"

What do you mean?

more replies More replies
More replies
More replies
More replies
[deleted]
[deleted]

The wireless ADB prompts on the device itself will tell you the IP to connect to...

u/AD-LB avatar

What prompt?

I'm talking about command line solution alone, via the PC.

More replies
More replies
More replies
u/apandya277 avatar

I really enjoy using SCRCPY.

It basically streams your phone's display to your computer over USB, letting you control it with the keyboard and mouse. Useful for responding to messages while working on your computer; you dont have to pick up your phone/use the touchscreen.

No root or proprietary OEM software needed!

u/need_tts avatar

They also added a wireless mode so you don't have to plug your phone in

The latency is very real with that one

u/DjGamewon avatar

I don't know if you're talking about the same wireless mode I am, but the one where you first connect by usb then adb tcpip works very good for me.

Yep, that

More replies
More replies
More replies

Can you answer calls on your PC with this?

u/apandya277 avatar

You could accept the call and turn on the speakerphone since you're controlling the touchscreen basically. Cant reroute audio to the PC though

u/Iguanzor avatar

you can if you connect your pc with your phone via Bluetooth and use it as an audio device, speaker works but haven't tried it with the microphone

u/cenTT

I have tried connecting my phone to my Windows PC using the "My Phone" in Windows since Samsung and Microsoft are both working together to make this connection work better, but it's super hit and miss. Sometimes it connects and works great, other times it doesn't connect at all and keeps telling me to check my phone, my connection etc. I haven't tried connecting through bluetooth though, I'll give it a try. Thanks!

u/Iguanzor avatar

oh, good luck!

also to clarify: I meant that you'll still need to use scrcpy for the screen sharing using adb but the audio part will be handled separately since your laptop will be acting as a speaker for the phone via bluetooth

more reply More replies
More replies
More replies

I see, that's exactly what I wanted to know, if I could reroute audio. Thanks!

More replies
More replies
More replies

Long press volume buttons to get next/prev song without turning on screen. works only on PowerAmp Afaik.

adb shell pm grant com.maxmpz.audioplayer android.permission.SET_VOLUME_KEY_LONG_PRESS_LISTENER

[deleted]
[deleted]

Comment deleted by user

I learned something new today. Thank you so much!

[deleted]
[deleted]

Comment deleted by user

Thank you very much!

More replies
u/xalbo avatar

Something that's pretty nifty is that you can use adb to send fake keypresses to your phone, for things like volume up/down, power, play, pause, mute, etc. So I wrote an AutoHotKey script that remaps the media keys on my keyboard to instead get sent to the phone (via wireless adb), so I can hit big fat physical keys to control the music playing on my headphones through the phone.

The command is adb.exe shell input keyevent 85 for "Play/Pause", and all the available keycodes are listed starting at https://developer.android.com/reference/android/view/KeyEvent#KEYCODE_0. I find the media keys particularly useful, but you can send anything you like.

Would you mind sharing the AHK script? I just can't do anything more than reassigning keys

u/xalbo avatar
#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn  ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.

;TODO: Look at using OnExit to disconnect adb

;Run C:\Users\me\Desktop\scrcpy-win64\adb.exe tcpip 5555
RunWait C:\Users\me\Desktop\scrcpy-win64\adb.exe shell :, , Hide UseErrorLevel
If (ErrorLevel != 0)
    Run C:\Users\me\Desktop\scrcpy-win64\adb.exe connect 192.168.1.103:5555, , Hide
return

Media_Play_Pause::
    Run C:\Users\me\Desktop\scrcpy-win64\adb.exe shell input keyevent 85, , Hide
return

Volume_Mute::
    Run C:\Users\me\Desktop\scrcpy-win64\adb.exe shell input keyevent 164, , Hide
return

Volume_Down::
    Run C:\Users\me\Desktop\scrcpy-win64\adb.exe shell input keyevent 25, , Hide
return

Volume_Up::
    Run C:\Users\me\Desktop\scrcpy-win64\adb.exe shell input keyevent 24, , Hide
return

Media_Next::
    Run C:\Users\me\Desktop\scrcpy-win64\adb.exe shell input keyevent 87, , Hide
    ;there's also skip forwards and fast forward; https://developer.android.com/reference/android/view/KeyEvent.html is full list
return

Media_Prev::
    Run C:\Users\me\Desktop\scrcpy-win64\adb.exe shell input keyevent 88, , Hide
    ;88 is previous; there's also skip backwards at 273 and rewind at 89
return

Media_Stop::
    Run C:\Users\me\Desktop\scrcpy-win64\adb.exe shell input keyevent 86, , Hide
return

Dang. Thanks a lot!

More replies
More replies
u/cheesegoat avatar

I use this to automate renaming my pokemon

More replies
u/bonerfalcon avatar

For those using full gesture navigation, ADB allows for turning off the back gesture from either side of the screen.

The command: adb shell settings put secure back_gesture_inset_scale_left 0

This one turns off the swipe back gesture from the left side. I always swipe back from right and the swipe from left is just a nuisance to me. I would assume that switching "left" to "right" in the command will turn off the other side, but I haven't tried it myself.

If you use Tasker you can grant additional permissions with adb.

u/LBHJ1707 avatar

May I ask what tasker is?

If you Google it it might say it's an automation app but it's so much more. For example I'm currently working on a fully functional D&D game made entirely with Tasker.

u/Rubyheart255 avatar

You have my interest. Tell me more?

If you're talking about Tasker here's a previous comment I made about what I use it for.

Some of my uses: So much but I use it for more than automation. Off the top of my head though. When connected to my cars Bluetooth it turns off WiFi, turns up screen brightness, turns up media volume and launches my music app. When I disconnect it turns on wifi (unless at work since we don't have wifi) turns down brightness, turns on do not disturb. Cycles through wallpapers every few minutes and army gfs it cycles through a few picks of her and I and the kids. When I open the calculator it turns brightness up (I work late and early at times) When I open my clock at night before bed it asks if I need to remember anything. Reminder built into my homescreen (total Launcher) Schedule on one of my homescreens Brought back now on tap screen copying. Made a grocery app that triggers when I go to the store. Use it to randomly pick between games to play as well as a custom coin and dice thing to help pick between choices. I made an addition, subtraction, multiplication and division games to help my gfs son with math. Made it so I can download or get the link to videos in free videos apps similar to popcorn time. I'm working on a full D&amp;D games. Save file backup for my emulators. I can launch any program or game on my PC with my voice or just selecting. So many more too. One of the first I made and favorites. When texted #wifi it automatically responses with my wifi password and when texted #album it sends links to my album. Also set it up so when my buddy gets to my house it automatically texts me here and I automatically respond k Had a notification to keep track of primary polling. Control Z with a swipe up on the right side of the screen (with fluid navigation gestures) so if I delete something while typing I can bring it back

About the D&D game or Tasker?

u/Rubyheart255 avatar

I've been using Tasker and Join for years. The idea of using Tasker for a fully fledged D&D game sounds interesting.

more reply More replies
More replies
More replies
u/MyCodesCompiling avatar

Why?

u/Surokoida avatar

Not the one you responded to but many I guess the reply many tasker user would give you is "why not?" :P

Precisely. Helped me learn a lot too!

More replies
More replies
[deleted]
[deleted]

Holy cow.

Awww yeah lol

More replies

but.....why?

Why make a D&D game? Because I can. Also made a really useful grocery app

Hey, fair enough.

more reply More replies
More replies
More replies
More replies

A search engine is begging for you to do just that

While you could Google it, it's a paid Automation scripter that has a lot of compatibility across various apps and functions.

My main Task chain is: GPS recognizes I'm home, volume max, airplane mode off, connect to WiFi, power on PC (Wake on LAN), open Chrome on PC, chime with a toast notification that tasks are complete.

I've seen people automate to close the garage for them and lock doors when they leave home, use "Okay Google" commands to control home automation, if you're driving you can set it to recognize GPS as moving faster than normal, so it could connect bluetooth to your car, launch Android Auto and play some driving tunes.

Some things require root access, but it's a very useful app...and doesn't require anything but initial set-up.

It's an app intended for automation, which, especially with extensions, can do basically anything. I'd recommend checking out autoinput with tasker, it's crazy!

More replies
More replies
u/RGBchocolate avatar

you can't install ADB on phone, ADB is part of Android system

More like enabled it and downloaded the binaries for your PC?

Tell that termux

u/RGBchocolate avatar

not sure what has terminal emulator to do with ADB

maybe nothing but i found a way to access adb on phone

Uh, how? It shouldn't be possible to run adb commands from the device itself.

Termux has ADB package for it but it will probably work withany terminal app. You can use ADB over network to connect to the phone. Then send commands to localhost which is phone. Basically adb connect localhost and you're in phone's shell. I'll share video after I get home.

more reply More replies
More replies
More replies
More replies
More replies
More replies
u/Yahiroz avatar

Force immersive mode in some apps, it looks great when the status bar is hidden for a true full screen experience.

[deleted]
[deleted]

I used to pull files from it. Like big gb files. Cause the mtp thing sucks for huge files and lots of folders.

u/Godecki avatar

Why is this question on this sub and not on r/androidquestions? No hate, but I am curious as similar query of mine was deleted.

u/LBHJ1707 avatar

I'll be honest i had no idea that sub existed.

u/Godecki avatar

Well, it's even mentioned in this sub's rules. Not a problem for me tho, but still interesting how such questions generaly get rejected here.

More replies
More replies
u/Margidoz avatar

You can try out FluidNG

u/PubliusDeLaMancha avatar

Long press volume up / down to skip tracks in music players

I made a program that uses adb to search for duplicate photos using md5 cryptography

u/Iguanzor avatar

does it search for duplicate photos within device or between the computer and phone?

Phone itself makes the hashes, PC selects the duplicates and deletes them from the phone! Try 'adb shell md5sum pathToFile'. If your phone has an old Android version try "md5" instead of "md5sum"

u/Iguanzor avatar
Edited

yeah doing the md5sum on phone is optimal

if you have termux you can run the whole script on the phone itself too!
something like

for file in $(ls path);
     do [ $(md5sum path/$file) == $(md5sum path2/$file) ] && rm any_path/$file || false
done

I haven't tried the code myself but after changing the variables it should work... maybe lol
if it doesn't its probably some syntax error just treat it as pseudocode :p

you can run the whole script from adb too

More replies
More replies
More replies
[deleted]
[deleted]

Comment deleted by user

u/bonerfalcon avatar

sigh I used the overscan command plus Fluid NG gestures for two years. I've spent all last month getting used to Google's gestures and I'm still not 100% pleased.

[deleted]
[deleted]

Comment deleted by user

u/DanWolfstone avatar

You and u/bonerfalcon should check out XDA navigation gestures

u/bonerfalcon avatar

I tried XDA and ultimately preferred Fluid. But anyway, they're pointless to me now, in Android 11.

More replies
More replies
u/RegularMicroVan avatar

In your particular case, you can force 90hz at all times on the 7 pro with an ABD command

Search for scrcpy

u/ClearFaun avatar

Control your phone from your computer.

[deleted]
[deleted]

Another unmentioned command is to disable heads up notifications system-wide.

adb shell settings put global heads_up_notifications_enabled 0

Doesn't work in OneUI though.

https://github.com/google/adb-sync

Syncronize files from cli. I use it to backup my photos to PC.