Say hello to LADB, a local ADB shell without needing root or a computer!

Search This thread

tytydraco

Recognized Developer
Mar 22, 2017
755
1,775
19
Hey there XDA! I'm here to show off a new Android app I've published that I think a certain audience may find useful.

Ever heard of ADB? If not, you likely won't need this app. But for those of you who have used or encountered ADB in the past, you know that you usually need a PC to shell into your phone. While yes, apps such as Termux exist, they don't have elevated privileges as ADB does.

Behold, LADB! A truly local ADB shell server. That means no root, no computer, and no hassle.

Here's how it works. LADB bundles an ADB server within the app libraries and extracts it upon runtime (W^X compliant). Normally, this server cannot connect to itself because it requires an active USB connection to be visible. However, Android's Wireless ADB Debugging feature allows the server and the client to speak to each other through localhost. LADB initializes the ADB server and asks to connect to localhost, solving this limitation.

So, what can you do with it? Well, anything that ordinarily uses "adb shell <command>" can now be done locally. That means granting apps special privileges for things like SystemUI Tuner, many logcat apps, and generally anything else that needs elevated privileges. That's not all though. You can disable system apps using pm disable-user com.android.whatever, you can enable and disable system overlays with cmd overlay, you can get a logcat with logcat -d | tail -n 20, and the possibilities go on.

Here's the link to the app. It is paid, and it's actually my first paid app in a very long time. If you just need to use the ADB server for a minute, you can buy the app, use it for a few minutes, and then refund it through the store (don't tell Google).

https://play.google.com/store/apps/details?id=com.draco.ladb

Note, this app is also open source! I'm a huge fan of FOSS so I went ahead and published the app on GitHub so that anyone can compile the app for themselves for free. Any purchases through the Google Play store can be considered as donations <3.

https://github.com/tytydraco/ladb

I'm always available for support if you encounter any issues either by direct message, by telegram (@tytydraco), or by email [email protected]. I'll also be answering questions in the comments of this post. Enjoy!
 

badmania98

Senior Member
Sep 23, 2007
2,062
683
52
ROMANIA
Huawei P40 Pro
” While we tested this and found it working on essentially every modern Android phone sold in the US in the last four years, not every device is guaranteed to have the Wireless Debugging feature. It's part of AOSP, Android's open source code base, but OEMs sometimes remove functionality from their skinned versions of Android. If your phone doesn't have this option, sadly, LADB won't work for you.

Unfortunately my Mate 30 Pro has not this option.

LE: I managed to work.
 
Last edited:

blackhawk

Senior Member
Jun 23, 2020
9,810
3,898
Samsung Galaxy Note 10+
This sounds cool.
Says it's compatible with my Note 10+; is this true? Works with Samsung's?
I like keeping the Android ecosystem as self contained as possible with the exception of hhd backup.
Any security risks directly associated with it?
 
Anybody tried to use appops https://play.google.com/store/apps/details?id=rikka.appops using ladb?
Is there a way to automate some task, for example after reboot?
Unfortunately my galaxy note 10+ has no wireless adb so i can't try 😪 but i hope it will come with android 11...

I quote myself...
I've a galaxy note 10+ (exynos) on android 10 and in the developer options there is no wireless debugging toggle, nevertheless ladb works!

Now a question: is it possible to execute "adb backup' or 'adb restore' in some way?
 
  • Like
Reactions: blackhawk

rypz79

Senior Member
Apr 27, 2013
387
68
Ramat-Gan
I quote myself...
I've a galaxy note 10+ (exynos) on android 10 and in the developer options there is no wireless debugging toggle, nevertheless ladb works!

Now a question: is it possible to execute "adb backup' or 'adb restore' in some way?
What do you mean by work? can you prompt an adb command?

I've the same device and it doesn't work (NO wireless ADB in devOpts) just waiting
20201228_172912.jpg
when I press reset it gives me this message
Screenshot_20201228-172830_LADB.jpg
And FC's.
Using v1.1.2 under Android 10 with rootfs.

Thanks
 
  • Like
Reactions: rypz79
I've no idea why it's not working on my SM-N975F (N10+) :rolleyes:
Say what ROM are you using? what kernel? do you have root access (magisk)?

TnXaLoT
I'm on stock rom (unrooted)
20201228_210113.jpg

I think you only need to start the wireless connection using the cable connected to a pc and then the wireless adb will survive until next reboot
 
  • Like
Reactions: rypz79

Tuvor

New member
Mar 28, 2021
1
0
I have ladb up and running but I am having trouble getting basic advanced commands to function.
When I enter:
adb shell pwd
It returns:
system/bin/sh: <stdin>[24]: adb: inaccessible or not found
It returns this for every adb command I have tried.
 

nicozam

New member
Jan 23, 2021
2
0
what happens if I disable the system keyboard (Gboard) on my oppo? I'm using SwiftKey and it "fights" with gboard autocorrection...
 

pawloland

Senior Member
Jan 23, 2019
186
74
Sony Xperia 5 II
I have ladb up and running but I am having trouble getting basic advanced commands to function.
When I enter:
adb shell pwd
It returns:
system/bin/sh: <stdin>[24]: adb: inaccessible or not found
It returns this for every adb command I have tried.
It isn't really a bug. On pc you would always type something like adb {acction} {parameters}. Adb - is the program which is going to be executed so in windows it will be adb.exe (it contains server for adb interface). Action - specifies what adb server should do, so things like devices - list adb devices, shell - open android shell. The last one contains parameters for action, so if you used shell as action it takes shell command as parameter. In this situation, when we use local shell we need to skip adb shell part because we don't have a whole adb server like adb.exe on windows with a lot more options, because we are always using just this adb shell functionality.
 

mathias.ngr

Senior Member
Oct 11, 2019
66
22
Bozen/Bolzano, IT
Sony Xperia 5 II
It isn't really a bug. On pc you would always type something like adb {acction} {parameters}. Adb - is the program which is going to be executed so in windows it will be adb.exe (it contains server for adb interface). Action - specifies what adb server should do, so things like devices - list adb devices, shell - open android shell. The last one contains parameters for action, so if you used shell as action it takes shell command as parameter. In this situation, when we use local shell we need to skip adb shell part because we don't have a whole adb server like adb.exe on windows with a lot more options, because we are always using just this adb shell functionality.

could you please explain this like I was completely stupid? 😂
I am trying to get running the SystemUITuner. When I enter the path with cd / /storage/emulated/0/Download/platform ecc LADB doesnt show anything. I think that should be ok. But when I then enter ./adb shell pm grant com.zacharee1.systemuituner android.permission.WRITE_SECURE_SETTINGS it tells me "permission dinied".

What am I doing wrong?
 

Ryano89

Senior Member
May 6, 2011
2,131
785
Indiana
OnePlus 6T
OnePlus 8T
could you please explain this like I was completely stupid? 😂
I am trying to get running the SystemUITuner. When I enter the path with cd / /storage/emulated/0/Download/platform ecc LADB doesnt show anything. I think that should be ok. But when I then enter ./adb shell pm grant com.zacharee1.systemuituner android.permission.WRITE_SECURE_SETTINGS it tells me "permission dinied".

What am I doing wrong?
You don't need to type " adb shell"....just type pm grant com.zacharee1.systemuituner android.permission.WRITE_SECURE_SETTINGS
See if that works
 

Top Liked Posts

  • There are no posts matching your filters.
  • 21
    Hey there XDA! I'm here to show off a new Android app I've published that I think a certain audience may find useful.

    Ever heard of ADB? If not, you likely won't need this app. But for those of you who have used or encountered ADB in the past, you know that you usually need a PC to shell into your phone. While yes, apps such as Termux exist, they don't have elevated privileges as ADB does.

    Behold, LADB! A truly local ADB shell server. That means no root, no computer, and no hassle.

    Here's how it works. LADB bundles an ADB server within the app libraries and extracts it upon runtime (W^X compliant). Normally, this server cannot connect to itself because it requires an active USB connection to be visible. However, Android's Wireless ADB Debugging feature allows the server and the client to speak to each other through localhost. LADB initializes the ADB server and asks to connect to localhost, solving this limitation.

    So, what can you do with it? Well, anything that ordinarily uses "adb shell <command>" can now be done locally. That means granting apps special privileges for things like SystemUI Tuner, many logcat apps, and generally anything else that needs elevated privileges. That's not all though. You can disable system apps using pm disable-user com.android.whatever, you can enable and disable system overlays with cmd overlay, you can get a logcat with logcat -d | tail -n 20, and the possibilities go on.

    Here's the link to the app. It is paid, and it's actually my first paid app in a very long time. If you just need to use the ADB server for a minute, you can buy the app, use it for a few minutes, and then refund it through the store (don't tell Google).

    https://play.google.com/store/apps/details?id=com.draco.ladb

    Note, this app is also open source! I'm a huge fan of FOSS so I went ahead and published the app on GitHub so that anyone can compile the app for themselves for free. Any purchases through the Google Play store can be considered as donations <3.

    https://github.com/tytydraco/ladb

    I'm always available for support if you encounter any issues either by direct message, by telegram (@tytydraco), or by email [email protected]. I'll also be answering questions in the comments of this post. Enjoy!
    6
    I can't believe you're charging folks, lol you didn't even do the leg work. Dude you realize your entire app depends on my work right?

    Donate the money to covid relief or something, don't take others work for your benefit, you did nothing, you literally coded a java ui, I've done this a bunch for substratum and andromeda with aapt and adb, lol you think you deserve 3 dollars for this? And that I deserve nothing? You literally need NEED my code for your crap to work, and you're going to charge these folks? I gave it away for free. What the hell is wrong with you?
    5
    Given you use the adb binaries I compiled, which is fine, I'd prefer if you made the app free for all folks :) Thanks.
    3
    You don't need to type " adb shell"....just type pm grant com.zacharee1.systemuituner android.permission.WRITE_SECURE_SETTINGS
    See if that works



    That worked. Thanks a lot and have a nice sunday! 😀👍🏼
    3
    Fwiw, I don't know you, and you probably think you took these binaries from osm0sis, but you didn't, I compiled them, and you can ask him if you want, he'll confirm it.

    The reason I don't want you to charge, is because without the binaries I compiled, the app doesn't work. You might say that your Java code for making a shell and user interface is worth it, if it is, if that's what you think the hardest part is, go for it and compile your own binaries.

    I realize they're open source, I didn't charge anyone or ask for any donations for my effort, and I expect the same from anyone using my work.

    Sadly you didn't even have the audacity to thank those who's shoulders you stepped on to make this app, nor did you even think to provide credit.

    As a dev for substratum and andromeda, both of which make a ui around a binary, I know first hand how hard it is.

    If you want to go the GPL route, I just ask you compile your binaries on your own, after all, you have no idea what changes I've made to adb, are you comfortable with selling that to folks?