We all know that running "adb shell" from the command line is pretty crap, and when using a latter busybox version which has coloring support it's ultimately crap. One workaround was usually to start a telnet server on the phone, and use putty to connect to that telnet server. Actually there is a more easier way to do that which also works for non rooted phones.
Actually the Android Debug Bridge has a terminal connection feature (roughly speaking), which will be enabled after you connect to the adb server in "0006shell:" mode. You can actually use the putty to connect to this interface always, by setting the following things:
- Turn off line discipline in settings
- Use RAW mode to connect to localhost:5037
- Enter "0012transport-usb" (without quotes)
- Enter "0006shell:" (without quotes)
Now you've got a full fledged connection to your device. The main drawback is that it's tedious to repeat the above all the time, so I've made some modifications to the putty binary that adds a new type of connection, called "Adb"
To use the enhanced putty:
- Select Adb from the connection type list
- Enter "transport-usb" in the host (or any other connection string, check the adb socket interface documentation if you need something else than connecting via usb)
- Enter 5037 as port, if it's not already set there.
- Connect and enjoy (you might also save this connection, so next time you only have to double-click on the settings)
DL and source: http://github.com/sztupy/adbputty/downloads
Screenshot:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Thanks for this sztupy! I had scripted out connecting to my N1 via putty, but lost the scripts.
I just tried connecting using your tweaked putty, but got an error. Here're a couple screenshots to show how I tried to connect and the issue I had.
Namuna said:
Thanks for this sztupy! I had scripted out connecting to my N1 via putty, but lost the scripts.
I just tried connecting using your tweaked putty, but got an error. Here're a couple screenshots to show how I tried to connect and the issue I had.
Click to expand...
Click to collapse
The only place where it uses gethostbyname is while querying "localhost". I don't know why this fails. (maybe IPv6 related(?)...) I'll replace it to actually use "127.0.0.1"...
Hi there, just go an LG Optimus 2X, and I'm starting to play with it.
But as my linux skill is almost inexistant I do have a hard time
So I wanted to use your alternate putty, mainly for tab-completion, but it doesn't work.
Putty is working, but "tab" is just tabing ...
Read that's a server functionality ==> does it mean that I need to install something on my phone ?
Thx for your time
goulloux said:
Hi there, just go an LG Optimus 2X, and I'm starting to play with it.
But as my linux skill is almost inexistant I do have a hard time
So I wanted to use your alternate putty, mainly for tab-completion, but it doesn't work.
Putty is working, but "tab" is just tabing ...
Read that's a server functionality ==> does it mean that I need to install something on my phone ?
Thx for your time
Click to expand...
Click to collapse
To have auto complete you need to have an auto-complete enabled shell on the phone. The default "sh" shell is very minimal (as usual phone users won't use it), so you need another one. Busybox's "sh" is actually "ash" which has all of the features you need. So to use this feature you have to have busybox installed (which is usually there if you have rooted your phone, or can be installed from market)
If you have busybox installed, then you have to run it's sh with "busybox sh" or "busybox ash". You'll get a new prompt with the new features.
Thanks for adb putty!
How can I configure Home and End keys?
Putty replacement
Hi there,
I don't know how relevant my post is in the context of this thread but I just wanted to let everyone know that I came across a new free terminal "ClearTerminal" which seems to be good.
You can try this one out if you need a replacement for putty or any other terminal.
It's available at clearconnex.com/content/clearterminal
Have a good time
I'm using the modified PuTTY above, which works great if there is only one device connected. Is there a way to specify a device# if you have more than one device connected?
Thanks,
Pretty sweet! How do you get the colors in the session? Mine is black & white only. Running CM7.1.
only colors ?
i think its the same ..
Euclid's Brother said:
I'm using the modified PuTTY above, which works great if there is only one device connected. Is there a way to specify a device# if you have more than one device connected?
Thanks,
Click to expand...
Click to collapse
For anyone interested in using this when multiple devices are connected, here's sztupy's response..
sztupy said:
Yeah it's possible, and if you know the ID's of the devices you can already do it. The "transport-usb" seciotn actually means that connect to the only available usb device. If there are more than one, you have to specify the actual one. Here is the command list: http://lxr.e2g.org/source/system/core/adb/SERVICES.TXT
According to it you have to use the "transport:<serial-number>" command
Click to expand...
Click to collapse
Thanks sztupy!
I don't know what is the problem but whenever i try to connect it just close it self.
Any ideas
[email protected]!n said:
I don't know what is the problem but whenever i try to connect it just close it self.
Any ideas
Click to expand...
Click to collapse
You may need to start the ADB server first. You can do this by running any ADB command such as "adb devices". Then try again your new PUTTY.
d00mz said:
Pretty sweet! How do you get the colors in the session? Mine is black & white only. Running CM7.1.
Click to expand...
Click to collapse
Mine too, it' s like the default command prompt window.
Sweet! Bash runs great with all the glorious ls colors. Thanks for this, sztupy.
mulţumesc!!
sztupy said:
We all know that running "adb shell" from the command line is pretty crap, and when using a latter busybox version which has coloring support it's ultimately crap. One workaround was usually to start a telnet server on the phone, and use putty to connect to that telnet server. Actually there is a more easier way to do that which also works for non rooted phones.
Actually the Android Debug Bridge has a terminal connection feature (roughly speaking), which will be enabled after you connect to the adb server in "0006shell:" mode. You can actually use the putty to connect to this interface always, by setting the following things:
- Turn off line discipline in settings
- Use RAW mode to connect to localhost:5037
- Enter "0012transport-usb" (without quotes)
- Enter "0006shell:" (without quotes)
Now you've got a full fledged connection to your device. The main drawback is that it's tedious to repeat the above all the time, so I've made some modifications to the putty binary that adds a new type of connection, called "Adb"
To use the enhanced putty:
- Select Adb from the connection type list
- Enter "transport-usb" in the host (or any other connection string, check the adb socket interface documentation if you need something else than connecting via usb)
- Enter 5037 as port, if it's not already set there.
- Connect and enjoy (you might also save this connection, so next time you only have to double-click on the settings)
DL and source: http://github.com/sztupy/adbputty/downloads
Screenshot:
Click to expand...
Click to collapse
Command history ?
Very nice tips and patch to putty !
It works great exept on one point :
I can't use command history, with commands I use before login (so during a previous login)
If I connect with adb shell with up arrow I see last commands I send. Not with putty-adb (neither with normal putty with manual 'login')
Can you access to your command history ?
Kytrix.
Kytrix said:
Very nice tips and patch to putty !
It works great exept on one point :
I can't use command history, with commands I use before login (so during a previous login)
If I connect with adb shell with up arrow I see last commands I send. Not with putty-adb (neither with normal putty with manual 'login')
Can you access to your command history ?
Kytrix.
Click to expand...
Click to collapse
That's because the sh on your phone does not support saving of command history. I don't know whether there exists an appropriate sh version for Android that supports this feature.
Now that I have the ADB enhanced Putty, I am annoyed that I have to manually launch the ADB server, so I wrote a batch file to start the ADB server daemon and then lauch Putty directly connected to the Android device. As described earlier, if you want to connect to a specific device, then you'll need to create and connect to a session that explicitly refers to the device ID. In my case I rarely have more than one Android device plugged in at a time, so the following batch file works for me. The session I'm connecting to is named "Android" which is why the command line for Putty uses @Android. If you had multiple connections, you could make this into a parameter and then invoke the shortcut with an argument then you could have a "Tablet" and a "Phone" shortcut. The script will wait until your device is found before launching Putty, so you can run the script and then plug in your phone later if it happens to be unplugged.
RUN-ADB-PUTTY.BAT
Code:
@echo off
cmd /C adb wait-for-device
start "PuTTY" /B "C:\Program Files (x86)\PuTTY\adbputty.exe" @Android
Once I created this file, I then made a shortcut to the script and placed it in my Windows 7 start menu.
New android app
swishman said:
only colors ?
i think its the same ..
Click to expand...
Click to collapse
Hi guys,
can you take a look at the new android app here :
http://forum.xda-developers.com/showthread.php?p=32619680
Thanks
Related
This was already mentioned by alansj here, but I though it was important enough to have it's own thread
Saurik has created a Debian image you can install onto your sd card. Once installed, you have the full power of debian on your phone. No more puny little busybox
Instructions and such are here.
Thanks Saurik!
I was actually looking into this earlier... let me know how it runs
cant download a few things
can not open ext2.ko......when i type insmod $kit/ext2.ko ...i get "insmod: can't open ' /sdcard/kit/ext2.ko'...some one please help me out
What graphical interface does this install, or is there one?
cbrunner said:
What graphical interface does this install, or is there one?
Click to expand...
Click to collapse
That was my question when I heard about this... I just went for it though because when I read through the instructions, I realized that everything is stored in the MicroSD card and in RAM (which is reset when the phone is rebooted)
It turns out that there is no GUI - just a good old text-based Debian install! I'm sure that someone will get one working... or maybe just port the entire BSD Subsystem along with apt so we can just forget the Market...
amgupt01 said:
That was my question when I heard about this... I just went for it though because when I read through the instructions, I realized that everything is stored in the MicroSD card and in RAM (which is reset when the phone is rebooted)
It turns out that there is no GUI - just a good old text-based Debian install! I'm sure that someone will get one working... or maybe just port the entire BSD Subsystem along with apt so we can just forget the Market...
Click to expand...
Click to collapse
This awesome article has answered tons of my questions and also seems to imply otherwise:
"This does not replace Android. This also gives you access to the full plethora of programs available in Debian and let's you continue using your phone as it was intended to be: as an Android device with all the capabilities thereof."
In addition, this IRC channel is where the author of that article idles.
cbrunner said:
This awesome article has answered tons of my questions and also seems to imply otherwise:
"This does not replace Android. This also gives you access to the full plethora of programs available in Debian and let's you continue using your phone as it was intended to be: as an Android device with all the capabilities thereof."
In addition, this IRC channel is where the author of that article idles.
Click to expand...
Click to collapse
Right. No gui, but you have a full working linux distro on your phone. You can apt-get just about any of the normal stuff.. You could probably even get a x-windows installation to working, although you would have to connect to it remotely - it would probably be "difficult" to get it to display a gui on the phone itself (although that would be sweet).
I've installed Saurik's image on my phone, it works great. Although if you do the "unionfs.sh" step, the wifi settings don't quite work right anymore. It won't let you enable or disable wifi.
But I was able to get an ssh server (with real user and password management) and even a samba server running on my phone quite easily with this . I've also got gcc installed, and will start playing around with developing directly on the phone (instead of having to cross compile).
Sorry for not being hip to the game, but what the heck is Debian?
donutman said:
Sorry for not being hip to the game, but what the heck is Debian?
Click to expand...
Click to collapse
Arguably the most influential distribution of Linux ever. Its package management system, apt, is awesome, and it is what Ubuntu and tons of other distros were started from.
Why would you not use Google before asking here?
can anyone help with my above mentioned problem
i want this baby to run
Is your phone connected to your computer? You lose access to the storage card when it is, I think (you can't cd to it when it's plugged in) and unplugging my phone allowed me to install the module.
/a
Installing Debian errors?
Here is what I get:
insmod $kit/ext2.ko
insmod: init_module '/sdcard/kit/ext2.ko' failed (Operation not permitted)
i've been through this, i'm not gonna explain what happens and why, but imo, the only way to get a real root is the following:
-Install telnet client to your device (from android market).
-Reboot your phone to be sure no telnet-daemons/shells are running.
-When you are on the desktop, just type "enter", "telnetd", "enter". (If you do it from the terminal app it will run under the uid of the terminal app which is not root).
-Then run the telnet client app, and connect to local host. (Or skip this step + the first one if you wanna connect from another pc)
I know it's weird, but when you run something from the terminal app it runs under the terminal app's uid, even if you run a new shell, you still are eg. "app_33", not root. and btw you will have to set the environment variables all from the same shell, that means you can't have a script cause it will run under another shell, with another uid. I'm so confused... maybe I'm wrong but android is not the most friendly environment.
aggtrfrad said:
i've been through this, i'm not gonna explain what happens and why, but imo, the only way to get a real root is the following:
-Install telnet client to your device (from android market).
-Reboot your phone to be sure no telnet-daemons/shells are running.
-When you are on the desktop, just type "enter", "telnetd", "enter". (If you do it from the terminal app it will run under the uid of the terminal app which is not root).
-Then run the telnet client app, and connect to local host. (Or skip this step + the first one if you wanna connect from another pc)
I know it's weird, but when you run something from the terminal app it runs under the terminal app's uid, even if you run a new shell, you still are eg. "app_33", not root. and btw you will have to set the environment variables all from the same shell, that means you can't have a script cause it will run under another shell, with another uid. I'm so confused... maybe I'm wrong but android is not the most friendly environment.
Click to expand...
Click to collapse
Haha I feel you. Now the thing is when I am at the home screen on my G1 i push "Enter" on the keyboard and then type "telnetd" and then push enter again it doesnt do anything. When I open up telnet client on my PC it wont connect with wifi on.
So I then go to Telnet client on myG1 and go to connect to "localhost:23" and it says "Error while connecting to server: localhost/127.0.0.1:23 - Connection refused" the thing is that my local host for my wifi is not 127.0.0.1:23
And when I "netstat" from inside Terminal Emulator there is no address with port "23"
ballaholyk84 said:
Haha I feel you. Now the thing is when I am at the home screen on my G1 i push "Enter" on the keyboard and then type "telnetd" and then push enter again it doesnt do anything. When I open up telnet client on my PC it wont connect with wifi on.
So I then go to Telnet client on myG1 and go to connect to "localhost:23" and it says "Error while connecting to server: localhost/127.0.0.1:23 - Connection refused" the thing is that my local host for my wifi is not 127.0.0.1:23
And when I "netstat" from inside Terminal Emulator there is no address with port "23"
Click to expand...
Click to collapse
Are you already running RC30?
SplasPood said:
Are you already running RC30?
Click to expand...
Click to collapse
Yes, I am running the Modified RC30 posted by JesusFreke
cbrunner said:
Why would you not use Google before asking here?
Click to expand...
Click to collapse
Because I wanted you to tell me baby. That is what a wife is suppose to do.
JesusFreke said:
Right. No gui, but you have a full working linux distro on your phone. You can apt-get just about any of the normal stuff.. You could probably even get a x-windows installation to working, although you would have to connect to it remotely - it would probably be "difficult" to get it to display a gui on the phone itself (although that would be sweet).
I've installed Saurik's image on my phone, it works great. Although if you do the "unionfs.sh" step, the wifi settings don't quite work right anymore. It won't let you enable or disable wifi.
But I was able to get an ssh server (with real user and password management) and even a samba server running on my phone quite easily with this . I've also got gcc installed, and will start playing around with developing directly on the phone (instead of having to cross compile).
Click to expand...
Click to collapse
What command did you use to get the SSH to install? Every time I do the one in the tut by saurik it errors and wont install all the way. I get an error after x11-common and it wont finish.
ballaholyk84 said:
So I then go to Telnet client on myG1 and go to connect to "localhost:23" and it says "Error while connecting to server: localhost/127.0.0.1:23 - Connection refused" the thing is that my local host for my wifi is not 127.0.0.1:23
Click to expand...
Click to collapse
localhost usually refers to the loopback interface which on most devices will be 127.0.0.1.
I'm getting the same thing here... I think there's something wrong with apt-get having to write to /tmp which does not exist (and is mounted read-only).
EDIT: Aleq has posted updated versions here: http://forum.xda-developers.com/showpost.php?p=23937844&postcount=36
Checked whether a project for creating a WinCE like plugin for total commander already exist, but couldn't find one, so here it is.
Disclaimer: This plugin is still in it's infancy, therefore it might crash you, your PC or your phone. It might not even start. But it'll improve.
1. What's this?
This is a filesystem plugin for total commander that let's you browse and modify the contents of your phone while using total commander
2. Why?
Although there are some android file managers out there, none of them I've found integrates into total commander. And if you've already using tcmd as a general file manager you usually don't want to open up a new program just to access your filesystem.
3. How?
The plugin uses the "adb shell" interface to communicate with the phone. It issues simple linux commands, parses the results and shows them to you in tcmd.
4. What's needed?
Total commander on your PC, busybox on your phone (root is not needed, but it will be used if available), and USB debugging turned on as well. Next download the plugin, open it in total commander and let it install.
5. Download location?
Download the latest version from here: http://github.com/sztupy/adbfsplugin/downloads
6. Supported features?
- directory listing
- copying from/to phone (very slow)
- copying/moving/renaming inside the phone
- creating and deleting directories
7. Whats needed?
- Better error handling
- Command line interface
- Attribute changing
- APK management
- etc.
8. Common pitfalls/limitations/etc.
- If the plugin can't start the adb server, wait a bit, then try it again
- The plugin won't ask you whether you want to overwrite a file or not, it will overwrite it
- Uploading and downloading files is very-very slow
- The plugin starts by trying to use su. If it can't get permission to use su (for example you pressed deny on the superuser page), it will run as a normal user.
Licence: GPLv3 (with the added exception that allows you to use the plugin with total commander... duh) and CC-BY-SA
Screenshot:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
reserved for later use
- deleted -
Excellent. I will follow the development of this plugin closely. For now I can't use it. I get an error when trying to browse the phone.
Code:
<0005 - stat failed>
EDIT: I am on a HTC Hero running CyanogenMOD 6.
Thanks for this... I have been using total commander for a few years now and I love it. I also use it to open up apk files and change images within them if I need too. I have made a lot of changes to my framework-res and com.htc.resources png files by simply using total commander. So great job on this
Perfect, thank you. Must needed tool for total commander and android users.
this is fine.
-it doesn't play nice with older busybox versions, there is an app (called Busybox) on the market that tries to install/update busybox, it is a great help
-symbolic links are not playing nice
other ways this is amazing
very nice idea
It would be nice if the plugin would use my already installed adb server instead of starting it's own (maybe in the future outdated) version.
Symbolink links and more compatibility with busybox < 1.17.1 is coming soon. I'm also working on linking this with adb putty, so running commands from the command line should work too.
I have installed the plugin, and have my phone connected in debug mode, but how do I access it now? I confirmed that adb shell is able to connect, but in Total Commander I see no way to access my phone. (The drive letters that are usually used for access while mounted don't work.)
I have experience with Total Commander, I have used adb shell, but I can't really figure this thing out...
jjwa said:
I have installed the plugin, and have my phone connected in debug mode, but how do I access it now? I confirmed that adb shell is able to connect, but in Total Commander I see no way to access my phone. (The drive letters that are usually used for access while mounted don't work.)
I have experience with Total Commander, I have used adb shell, but I can't really figure this thing out...
Click to expand...
Click to collapse
filesystem plugins ccan be found at the network neighborhood
sztupy said:
filesystem plugins ccan be found at the network neighborhood
Click to expand...
Click to collapse
Oh wow, that is not a place I would look for my USB-connected phone .
But it works now, thanks .
Edit:
it is indeed very slow. A shame, because that means it's actually not a practical way to regularly put music and videos on my phone and download my photos off of it. Is there a chance the low speed can be fixed?
Also, there are several applications that allow you to use ADB wirelessly, could you support that in this plugin? Would be a very nice feature!
I believe they all use 'adb connect IP-addressort' on the computer's side to connect to it, so that does not sound very difficult to me.
Thanks for your work so far, initiatives like these are very appreciated
Nice app. Thanks!
Thanks for this. I prefer Directory Opus but I will use Total Commander just for this plugin. Thank you!!!
jjwa said:
Oh wow, that is not a place I would look for my USB-connected phone .
But it works now, thanks .
Edit:
it is indeed very slow. A shame, because that means it's actually not a practical way to regularly put music and videos on my phone and download my photos off of it. Is there a chance the low speed can be fixed?
Also, there are several applications that allow you to use ADB wirelessly, could you support that in this plugin? Would be a very nice feature!
I believe they all use 'adb connect IP-addressort' on the computer's side to connect to it, so that does not sound very difficult to me.
Thanks for your work so far, initiatives like these are very appreciated
Click to expand...
Click to collapse
The speed issue is on the todo list, but it will be never as fast as the native usb connection. (the same was true with the WinCE/activesync plugin too)
Win XP / TC 7.55a
Installation OK, but no registered name "Android" available in TC's network neighborhood. (even though TC plugins manager reports successful registration).
Thanks
WOW great job....that plugin is awesome!
Support for ADB WiFi would be great!
tristan202 said:
Excellent. I will follow the development of this plugin closely. For now I can't use it. I get an error when trying to browse the phone.
Code:
<0005 - stat failed>
EDIT: I am on a HTC Hero running CyanogenMOD 6.
Click to expand...
Click to collapse
Same here, running CyanogenMOD 6 on a HTC HD2.
It shows my root, but doesn't show anything besides the SD card as a folder, so I can't browse to any system path.
Sent from my xtrSENSE Eris using XDA App
rschalie said:
Same here, running CyanogenMOD 6 on a HTC HD2.
Click to expand...
Click to collapse
Does cyanogenmod's busybox support the "stat" command?
Hello XDA-Developers,
Its raining today and since I have a ton of real important things to do around the house this seems more important and overall fun.
I'm an Firmware Engineer and most of my life is in command line and I've seen lots of how to ssh into android but its a lot of work. I'm a big fan of KISS (Keep it simple stupid) and since everyone isn't a command line junkie I'm giving back today. Ok lets get to it.
The best money I've spent so far into the android market is on Quicksshd ($1.49) , it gives you the IP, opens port 22 and allows you to set a password and ssh into the phone over wireless too. I don't work for Quciksshd I just use it and its worth the money.
Here is the link for quicksshd
Here is the link for the dev's site http://teslacoilsw.com/quicksshd
So now that you have the quicksshd on your phone and made use port 22 and make a password. This is a example for changing the DNS on the android phone.
If your on a PC download putty I'm on a mac so terminal is what I use and it comes with it. Putty is what I use at work.
We are changing the DNS the phone! Make sure you make a backup of your resolv.conf if you want to change it back. Or just back up your whole phone for the people whom are really unsure of this operation.
(I'm already root on my mac, you don't have to but on your PC)
sh-3.2# ssh [email protected] (your IP may be different)
The authenticity of host '192.168.1.4 (192.168.1.4)' can't be established.
RSA key fingerprint is c2:4f:07:7e:5b:cc:9c:76:3a:fe:07:be:ed:86:7a:2d.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.1.4' (RSA) to the list of known hosts.
QuickSSHD for Android
[email protected]'s password:
(Notice the # Your ROOT)
# pwd
/data/data/com.teslacoilsw.quicksshd/home
# cd /system
# mount -o remount, rw /system
# cat > /system/etc/resolv.conf
(I'm changing the dns to google dns and open dns). It's made a huge difference in my connections and speed. Your experience could be different. With Wifi on I get up to 26 megs down and 10 up. With just the radio and no wifi I get between 5 and 3megs down and 4 up.
nameserver 8.8.4.4
nameserver 8.8.8.8
nameserver 208.67.222.222
nameserver 208.67.220.220
CTRL C
#chmod 4755 /system/etc/resolv.conf (notice the # again? We are ROOT)
#shutdown -r now (shutting down the phone) In linux it would reboot but it does not here.
Now you can copy and paste each and every line and you should not have problems at all. I'm looking into just making this a script and adding it to my rom and when its done I'll post it.
Here is the copy and paste mode.
# cd /system
# mount -o remount, rw /system
# cat > /system/etc/resolv.conf
nameserver 8.8.4.4
nameserver 8.8.8.8
nameserver 208.67.222.222
nameserver 208.67.220.220
Ctrl C
#chmod 4755 /system/etc/resolv.conf
#shutdown -r now
Remember to power your phone back on.
If you found this useful give me a thanks.
+1 for Quicksshd, I use it too, it's simple and perfect for what I need.
and about
Code:
#shutdown -r now (shutting down the phone) In linux it would reboot but it does not here.
feel free to use command
Code:
#reboot
This guide is much betterhttp://forum.xda-developers.com/showthread.php?t=1030107
AdamOutler said:
Introduction:
Here is how you can obtain unrestricted file access to your phone.
Most of the time you don't need to access the restricted areas of your phone. Sometimes it's required. I like to use SSH/sftp as it is very compatible with everything.
Here are some of the benefeits of using this technique:
Dual mount ( you can copy to and from the phone while using the sdcard)
wireless mount (copy to your sdcard without cable)
wireless root shell (root terminal access)
This guide will allow you to do the following things:
modifying data partition
grabbing APKs from your phone
unlimited access to all data
full, unrestricted access on your /system partition
Warning:
By using the techniques available in this thread, you will have unlimited access to your phone. This will give you the ability to destroy your phone. Realize that you must be careful of performing any modification as there are thousands of files on your phone and trying to find the problem can be a nightmare. It's a good idea to keep a written log and a backup of any files you modify so that you can go back and restore them.
You will need:
Root access
This guide expects your phone to be rooted at the start. The easiest way to make the root account available on your phone is to use Super1Click.
How-To:
1. mount system rw
a. mount system RW with market app sgs tools
b. mount system RW with market app "mount system r/w"
2. enable a SSH/SFTP server
a. enable sshd server with market app "QuickSSHd" -paid $1, and very much worth it.
b. enable sshd server with market app "SSHDroid" - free, limited features
Make sure you select a SECURE password so that it cannot be brute force hacked over the cell network.
3. Make a shortcut on your desktop to your phone's ssh and sftp addresses
a. under linux:
sftp://[email protected]
gnome-terminal -x ssh -X [email protected]
b. under Mac:
sftp://[email protected]
terminal -x ssh [email protected]
c. under Windows:
use WinSCP -for help with setting up winSCP, see post #4
or putty (thanks boardsportsrule)
Shortcuts make things easier to access. Creating shortcuts will allow you one-click wireless dual mount, or one-click root shell. This basically makes your phone like a USB drive attached to your computer at all times.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
4. copy to or from "/system/app" or "/data/app" freely
NOTE: Any SFTP Client can be used like "root explorer", the paid market app
a. use a filemanager like Astro to network sftp into loopback address (sftp://127.0.0.1) and copy the file
b. use your computer to SFTP into your phone and copy the file
5. reboot the phone after applying battery mods or new system apks.
This should get you going in the direction you want.
Why use SSH instead of ADB?
SSH is a tunneling protocol, meaning SSH itself is not a protocol, but rather a transport mechanisim. It's an encrypted and password protected tunnel from one computer to another. ADB is unencrypted and designed for a USB connection. Using ADB Wireless allows anyone on your network to push applications and run commands on your phone without authentication. This is a huge security hole. While ADB wireless can do the same things, it's not equipped to do the job properly. As a rule, use ADB for debugging applications or for wired connections. SSH, because of it's small footprint and no processor usage when idle is perfect for an always-on, password protected, encrypted, secure connection.
Hit me up with any suggestions or comments. I will happily add your information in here.
Disclaimer: All materials presented are for informational purposes. This video is not an authorization, advertisement, nor a suggestion to flash your phone with custom firmware. In no event shall I be held liable for any direct, indirect, incidental, spcial, exemplary, or concequential damages, including but not limited to loss of data, business interruption or damage to equipment. This information is released AS-IS with no written or express warranty or liability.
Click to expand...
Click to collapse
TRusselo said:
ok got bored tried things your way.
i really liked WinSCP, even more when i got it setup nicely.
it definatly wasnt made BY windows users but was made FOR.
with a few tweaks, in the setup and options it is really easy to use.
WinSCP even INTEGRATES into windows to handle all Sftp and SCP addresses automatically!
on my android phone i am using " QuickHSSd" has 2 nice desktop widget toggles.
use Root Explorer to mount system (or other method)
turn on QuickSSHd
and WinSCP does the rest!
created a little guide for noobies to use this really good program and understand through familiarity.
hide/disable un-needed things, show familiar parts, and optimize for our phones with flash memory! (eg. one file at a time)
ENJOY!
Click to expand...
Click to collapse
I don't know if its better? Its longer and more screenshots.
Have you ever dreamed of an app to execute your favorite shell commands, whether it is for collection dmesg/logcat/dumpsys or set kernel parameters.
Well here comes CommandCenter, a generic app for grouping all your favorite commands.
CommandCenter is free with ads and can be downloaded from the Google Play (please be patient, it takes a while to update as I just published)
It is also open source and your can check my repo to inspect / review the code.
If you are a kernel developer you may want to provide a tool for your users to run certain commands without havint to maintain an app for that; if yes just submit a Command Set and have your users download it.
If you are a poweruser there are commands that you use all the time, wither from adb shell or in the terminal. Make one or multiple Command Set and enjoy the comfort of an Android app and the power of your favorite commands.
From version 0.10 a Locale / Tasker Plugin was added to execute command from actions.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
How it works
The command sets are stored of the sdcard in the app's private folder /sdcard/Android/data/com.asksven.commandcenter/files in the form of json files. On load the files are parsed and each file (Command Set) shown as a tab.
A single click on a Command displays its details, a long click pops up a dialog from where you can run the command (this is configurable in the preferences).
A command has two parts:
- the command to be executed itself: it may contain a variable and in that case a popup will ask for the value to be used
- an optional command to retrieve a status: if a status can be read it will be displayed
CommandCenter comes with two pre-configured Command Sets:
- general commands for logging / diagnosis
- a few command for Fracisco Franco's awsome GN kernel
Want to contribute?
If you want to create and distribute command set just drop me a PM. I would be happy to give you more details about the syntax of the command sets and there is a section in this thread to list authored Command Sets. I may also add some to the Market app.
Caution
Always check the command's before running them. CommandCenter support 'su' command and you should know what you do as those could harm your phone. I will not take any responsibility for any dammage caused by command run using CommandCenter
Contact
You can contact me here (PM, this thread) or on twitter
Release Notes
v0.11.0 2012-07-24
Major fix: added synchronization to avoid freeze conditions
#24: "refresh" reads changes on command collections from the external storage
#26, #27, #28: different error conditions from reports
v0.10.1 2012-05-06
#15: samples scripts were being re-created on every start instead of once at first install
#14: FC when turning to portrait
#16: FC when number of result lines for a command < 5
#17: Various FC conditions from google play logs
#21: error in one script should not cause the other not to load
v0.9.0 2012-03-10
Solved stability issues (threaded processing)
Tablet support
#8: new command dialog layout
v0.8.0 2012-02-24
#4 Popup menu was called "edit"
#5 added support for user defined and editable commands
#6 added support for commands returning data
v0.7.2 2012-02-12
#2: dumpsys missing su, and logcat files have zero-length
#3: A few issues with backward compat to Android 2.1/2.2 fixed
v0.7.1 2012-02-11
#1: fixed Android 2.1 compatibility issue
v0.7 2012-02-11 Initial release
Command Sets
If you want to create command set for CommandCenter please read this
FAQ
For future use
sounds quite nice, can't wait to try. Have been using Tasker + Secure Settings for that so far, let's see how it compares.
V0.7.1
Fixed a minor issue with Android 2.1 (getExternalFilesDir does not exist on Eclair)
When I try and dump logcat radio or logcat it creates the file but it's blank. Also when I dump alarms the file reads Permission Denial: can't dump AlarmManager from pid=5637, uid=10128. ComandCenter never ask for SU Permissions. I ran the dump alarms with su permission from the terminal and it worked fine. HTC Inspire running ICS.
harpo1 said:
When I try and dump logcat radio or logcat it creates the file but it's blank. Also when I dump alarms the file reads Permission Denial: can't dump AlarmManager from pid=5637, uid=10128. ComandCenter never ask for SU Permissions. I ran the dump alarms with su permission from the terminal and it worked fine. HTC Inspire running ICS.
Click to expand...
Click to collapse
Ok the alarm dump is fixed, it was a definition error in the command set (dumpsys did not require su).
Testing the other commands now on rooted and unrooted device
V0.7.2
Fix-Release is rolling out, see post #2 for release notes.
I did quite a lot of testing on 2.1, 2.2, 2.3 and 4 devices with and without root and I hope the fixes work for everyone.
chamonix said:
Fix-Release is rolling out, see post #2 for release notes.
I did quite a lot of testing on 2.1, 2.2, 2.3 and 4 devices with and without root and I hope the fixes work for everyone.
Click to expand...
Click to collapse
Thanks for fixing this so fast. Everything is working perfectly now. Great app.
Another great release from chamonix
I have been looking for an app like this..so thank you very much. Now I'll start study it to take full advantage from it
Sent from my sandwiched SGS
It's time to collect some feature requests and build some use cases. Do you guys have suggestions for feature or know a kernel dev who has no time to write a sexy "settings" app. I'd be happy to provide the command sets while finalizing the schema aiming at making it public for contributors
Should it be possible to add or modify the command sets? I don't seem to be able to do either. In Edit mode, my soft keyboard never open and I don't see any option to create a new command set. Maybe I'm just not looking in the right place?
This is on a Samsung Galaxy Nexus running a rooted AOSP ICS.
short/y said:
Should it be possible to add or modify the command sets? I don't seem to be able to do either. In Edit mode, my soft keyboard never open and I don't see any option to create a new command set. Maybe I'm just not looking in the right place?
This is on a Samsung Galaxy Nexus running a rooted AOSP ICS.
Click to expand...
Click to collapse
In fact the is no way of editing the commands from within the app. I have been thinking about that a lot and the functionality itselt is not the problem (it occurs to me that the popup menu is named "edit" and this is of course not correct).
The reason I did not provide edition of commands within the app is that I want to offer a distribution channel for authors to update their command sets. Those updates would overwrite the local changes.
What you can do to edit the commands is edit the json files located on the sdcard in Android/data/com.asksven.commandcenter/files (one file per command set).
Do you feel the need to have "local" commands as well that could be edited from the app and stored in a local database?
chamonix said:
In fact the is no way of editing the commands from within the app. I have been thinking about that a lot and the functionality itselt is not the problem (it occurs to me that the popup menu is named "edit" and this is of course not correct).
The reason I did not provide edition of commands within the app is that I want to offer a distribution channel for authors to update their command sets. Those updates would overwrite the local changes.
What you can do to edit the commands is edit the json files located on the sdcard in Android/data/com.asksven.commandcenter/files (one file per command set).
Do you feel the need to have "local" commands as well that could be edited from the app and stored in a local database?
Click to expand...
Click to collapse
Local commands would be handy also you can do generics for brand htc Samsung etc as the kernels tend to have commands in the same spot, also a log viewer would be cool but they are. Readily avaliable
Sent from my HTC Evo 3D using Tapatalk
Auto upload to paste bin would be sick and the ability to email to dev as well as adding the kernel version to the file name
Sent from my HTC Evo 3D using Tapatalk
chamonix said:
In fact the is no way of editing the commands from within the app. I have been thinking about that a lot and the functionality itselt is not the problem (it occurs to me that the popup menu is named "edit" and this is of course not correct).
The reason I did not provide edition of commands within the app is that I want to offer a distribution channel for authors to update their command sets. Those updates would overwrite the local changes.
What you can do to edit the commands is edit the json files located on the sdcard in Android/data/com.asksven.commandcenter/files (one file per command set).
Do you feel the need to have "local" commands as well that could be edited from the app and stored in a local database?
Click to expand...
Click to collapse
Yes, I'd like to have that. I can think of a few I'd like to have NOW as opposed to waiting for someone to come up with them
Code:
df -h /sdcard
df -h
ls -lrt /mnt/sdcard | tail
ls -lrt /sdcard/Download | tail
ping www.google.com
ifconfig lte_rmnet1
netstat -rn
netstat -l
netstat | grep CLOSE
uptime
And probably few others that I could come up with once I really thought about it. Why not have "protected" command sets which are updated thru the app or Market and "user" or, as you call them, "local"?
First of all, thanks for develop another great application.
I concur that having the possibility to add commands is really a 'must have'. Of course, if we are thinking about to create commands, this means all of us have already a terminal app installed to run them, but the purpose of this app is to make life easier for having our favorite commands ready to execute. Many of these commands are possibly a small subset of common ones, but even with that, I probably prefer to redirect the output to a diffferent place that abother user using the same command. So having a 'user tab' to be able to add, edit and delete commands (also maybe copy a command from other tab) will be very useful.
Anyway, congrats for comming up with this useful app.
short/y said:
Yes, I'd like to have that. I can think of a few I'd like to have NOW as opposed to waiting for someone to come up with them
Code:
df -h /sdcard
df -h
ls -lrt /mnt/sdcard | tail
ls -lrt /sdcard/Download | tail
ping www.google.com
ifconfig lte_rmnet1
netstat -rn
netstat -l
netstat | grep CLOSE
uptime
And probably few others that I could come up with once I really thought about it. Why not have "protected" command sets which are updated thru the app or Market and "user" or, as you call them, "local"?
Click to expand...
Click to collapse
One question about those commands: some of them return results that will not fit on one line and so would not fit in the space reserved for the status (lower line in the list).
How would you like to display the result?
- as a popup when running the command
- as a multi line status field 'growing' when required and updating automatically
pp1276 said:
First of all, thanks for develop another great application.
I concur that having the possibility to add commands is really a 'must have'. Of course, if we are thinking about to create commands, this means all of us have already a terminal app installed to run them, but the purpose of this app is to make life easier for having our favorite commands ready to execute. Many of these commands are possibly a small subset of common ones, but even with that, I probably prefer to redirect the output to a diffferent place that abother user using the same command. So having a 'user tab' to be able to add, edit and delete commands (also maybe copy a command from other tab) will be very useful.
Anyway, congrats for comming up with this useful app.
Click to expand...
Click to collapse
I am convinced: https://github.com/asksven/CommandCenter/issues/5
Is there an updated XDA tutorial yet on setting up adb COMPLETELY wirelessly as of Android 11?
Why do I ask?
Using adb is a critical developer/hacking/user tool
As of Android 11, adb has been fundamentally changed for Wi-Fi
As of Android 12, adb was further improved for Wi-Fi
The existing XDA Developers' tutorial doesn't contain that info
I figured it out on my own (see below)...
(Which meant a LOT of new questions popped up that had to be solved that could have been answered in a tutorial)
Unfortunately, almost everything out there that I can find about adb is (wrong / inaccurate / incomplete [choose one]) in terms of how to set up a wi-fi connection as of Android 11 & 12.
The problem is there are important questions to be solved that are MISSING from that old tutorial
(These problems revolve around connection completely from the PC side only)
Where I would think EVERYONE would have the SAME questions as I do about the new setup
(And for which an updated XDA Developers' adb tutorial would be very useful!)
Mostly these new Android 11+ Developer options Wireless debugging features eliminate the USB cable.
But that then instantly brings up the non-intuitively fundamental question of ESTABLISHING the connection solely from the PC...
(which - let's never forget - is how the older, well documented USB-cable-first-then-Wi-FI adb connection had always been done)
Hence my question of:
Is there an updated XDA tutorial yet on setting up adb COMPLETELY wirelessly as of Android 11+ & 12+?
DETAILS:
Spoiler: Short summary of steps which should be in a tutorial
Given how important adb is to Android software development and hacking, I searched for an XDA Developers writeup on how the newly added Android 11+ Developer options Wireless debugging works and which incorporates a few of the even more newly added Android 12+ Developer options Wireless debugging tiles (which are CRITICAL but it's not obvious to those who haven't done it why those new Android 12 tiles have to be used every day all day!) & Android 12's separate ability to randomize the phone's MAC address for every Wi-Fi connection for added privacy (not just for every Wi-Fi SSID as Android 11 did it) which itself has further implications for reserving IP addresses (usually erroneously referred to as "static IP addresses" in the router and on the phone) for those daily random-port connections using adb over Wi-Fi only. You can no longer connect "from" the PC until after you physically "look" (using live human eyeballs!) to locate either the random port assignment (for "adb connect") or a different random port assignment plus a random pin assignment (for the new Android 11+ encrypted "adb pair" command). Now you can connect via adb over Wi-FI from the PC. But bear in mind the catch! Frequently (upon reboot for example), the Android 12+ tile turns off, as does the Developer options:Wireless debugging toggle, as does the Wi-Fi connection (in my case for privacy, as I have Wi-Fi toggle off when I leave the range of the LAN - which then turns off Wireless-debugging in an unintended cascade) but more importantly, frequently the random port assignment changes as does the random pin assignment. So you have to perform the all-important human-eyeball LOOK frequently - which you would rather not need to do if you could help it
Whew! I said what "should" be in a tutorial so others don't have to figure all of that out on their own just to set up adb completely wirelessly (without first establishing a USB connection on the PC).
I figured it all out, of course, but that XDA Developers writeup didn't help (in fact it hurts)... because it contained completely outdated information (which is why I wrote that long paragraph above, to summarize what's completely missing).
Here's what needs to be done on the phone:
Enable Wi-Fi (mine is set up to NOT auto-reconnect, for privacy)
Establish a connection over Wi-Fi to an SSID on your LAN
Enable Developer options:Wireless debugging (Android 11+)
Enable Developer options:Wireless debugging Tile (Android 12+)
Enable random MAC address per SSID (Android 11) or per connection (Android 12+)
Enable the (so-called) static IP address of the phone
Physically eyeball the random Wireless debugging port assignment (&/or random port + random PIN)
Note all the questions are related to the fact everyone wants to eliminate that last step above!
On the PC:
Simply assure yourself that the phone is on the LAN (e.g., ping 192.168.0.2) (duh)
Remember - it's using a RANDOM MAC address so the router has to be configured for that
Then connect from the PC adb to the phone completely over Wi-Fi (encrypted or not)
Remember - there's no initial establishment via USB - which means you need to know random ports!
adb connect 192.168.0.2:12345 (or) adb pair 192.168.0.2:12345 123456
Remember - everyone's goal is to obtain those random ports 100% from the PC side of things
You may have to accept an encryption dialog on your phone if this is the first time using that PC
At this point, adb over Wi-Fi works the same as adb has always worked (over USB first, then over Wi-Fi).
Until, of course, Android randomly resets the port assignment - which it does frequently!
Then you're back to having to look at the phone for the random port assignment
Notice that most of the issues people are having (see reference list below) are related to the fact that the random port assignement, as far as we know, can ONLY be obtained from a visual inspection of the Android phone - but also notice that nobody used to need to do that in the olden days (when we connected via USB cable first!).
My observation is nobody wants to do that visual inspection of the phone every time, all day, every day, whenever Android re-randomizes the MAC address (which, for me, happens frequently but my phone is set up specifically for Wi-FI privacy).
In summary, this thread asks if there is an XDA Developers' writeup for connecting adb on the PC completely wirelessly to Android 11 and Android 12 and up.
The REASON I believe that XDA Developers' updated adb tutorial is needed by hackers/developers/users is:
a. The way adb works over Wi-Fi is COMPLETELY DIFFERENT as of Android 11 (this is why finding an updated tutorial is needed!)
b. I had to figure all this out on my own, so that means everyone else does too (unless I missed the XDA Developers' tutorial), and,
c. There are still a ton of open unanswered questions that everyone also has.
REFERENCES: (in no specific order, these are attempts to make it work the way everyone wants it to work!)
(PSA) Using the new Android 12 TILE for 'Developer options' 'Wireless debugging' to establish adb connection over Wi-Fi without USB
What's the difference between Windows/Android adb "connect" versus adb "pair" when mirroring Android 12 over Wi-Fi onto a Windows PC?
Android 12 Developer options adb "Wireless debugging" option keeps turning off
[adb,scrcpy,vysor] What ports does Android 12 randomly set when Wi-Fi connecting via Wireless debugging adb "pair" or "connect" commands?
[adb] What is the adb syntax to connect wirelessly to Android by unique serial number (instead of by Wi-Fi LAN IP address & random port assignment)?
Note that none of those threads would be needed if we could have found a comprehensive tutorial that was updated to Android 11 and 12 new connect-adb-over-Wi-Fi-without-USB functionality that answers those basic obvious questions to ask. (See illustrative screenshots below).
Is an updated XDA Developers' writeup extant for connecting adb on the PC completely wirelessly to Android?
I simply use ladb - it's an app that makes the whole process a breeze
See a big xda write up about it here ..
How to debloat your phone (and more) without connecting to a PC
LADB is an app that lets you run ADB shell commands from your phone, no root and no PC needed! Use it to debloat your phone and more!
www.xda-developers.com
CFKod said:
I simply use ladb
Click to expand...
Click to collapse
Thanks for that advice to use Local ADB which "leverages Android’s built-in support for ADB over WiFi to provide a GUI for sending shell commands straight from the Android device."
The great news is that was the first XDA Developers' tutorial that I've seen that showed cognizance of the new Android 11 features of setting up adb completely wirelessly (without need for USB first).
* GitHub: LADB (A local ADB shell for Android!)
The bad news is that, at least upon initial inspection, ladb doesn't do anything you can't do inside of Termux as far as I can tell (is that correct though - maybe the ladb apk can do more privileged actions?).
Spoiler: Example of doing in Termux what would often be done in adb
1. Install F-droid <https://f-droid.org/>
<https://f-droid.org/F-Droid.apk>
2. Install F-Droid Termux <https://f-droid.org/en/packages/com.termux/>
<https://f-droid.org/repo/com.termux_117.apk>
3. Add F-Droid Termux Widget <https://f-droid.org/en/packages/com.termux.widget/>
<https://f-droid.org/repo/com.termux.widget_12.apk>
4. Run the F-Droid Termux & create an alias we'll name "rad" for reset ad id.
$ rad
(This should report: No command rad found)
$ alias rad 'am start -n com.google.android.gms/.ads.settings.AdsSettingsActivity'
$ rad
(this should pop up the "Reset Advertising ID" Activity on your phone
(manually close that Activity for now - we can programmatically close it later)
$ cat ~/.bashrc
cat /data/data/com.termux/files/home/.bashrc
No such file or directory
$ alias > ~/.bashrc
$ cat !$
alias rad='am start -n com.google.android.gms/.ads.settings.AdsSettingsActivity'
$ unalias rad
$ rad
(This should report: No command rad found)
$ source ~/.bashrc
$ rad
(this should pop up the "Reset Advertising ID" Activity on your phone
(manually close that Activity for now - we can programatically close it later)
5. Run the F-Droid Termux and create two directories for the shortcut widget
$ mkdir -p $HOME/.shortcuts (we will put our shell script here)
$ mkdir -p $HOME/.shortcuts/tasks (we didn't use this directory yet)
6. Create a shell script to open up the reset ad id Activity.
$ cd $HOME/.shortcuts
$ nano ./rad.sh
Edit the result to look like this:
#!/data/data/com.termux/files/usr/bin/bash
am start -n com.google.android.gms/.ads.settings.AdsSettingsActivity
$ chmod +x ./rad.sh
$ ./rad.sh
(nothing will happen)
7. Modify termux to be able to execute user shell scripts on Android.
$ pkg install termux-exec
8. Test your shell script.
$ ./rad.sh
(this should pop up the "Reset Advertising ID" Activity on your phone
(manually close that Activity for now - we can programmatically close it later)
9. Add the Termux Widget to your homescreen.
Long press your Android homescreen.
Select "Widgets" & then "Termux:Widget" & place it on your Android homescreen.
It will ask: Create widget and allow access? to which you press "Yes"
Then press the "rad.sh" entry showing up in that Termux Widget.
"Termux requires "Display over other apps" permission
to start terminal sessions from background on Android >=10."
"Grants it from Settings -> Apps -> Termux -> Advanced"
10. Grant Termux permission to display over other apps:
Android11:Settings > Apps > Your apps > Termux > Appear on top = (change off to on)
11. Now press the Termux Widget entry named "rad.sh"
(this should pop up the "Reset Advertising ID" Activity on your phone
(manually close that Activity for now - we can programmatically close it later)
12. Reboot the phone & ensure everything is persistent.
Tap the new homescreen icon after rebooting
& the "reset ad id" Activity should pop up.
But worse, the LocalADB instructions clearly say to do the same manual (aurgh!) steps we've been doing all along.
That is, even with LADB, they're still NOT obtaining the random port address programatically; they're getting it manually - just like I've been doing all along without LADB.
So ladb doesn't change anything... as far as I can tell (but maybe I'm wrong?).
"Copy the 6 digit “Wi-Fi pairing code” and paste it into the “pairing code” box in LADB. Copy the 5 digit port number from the IP address (the 5 numbers after the colon) and paste it into the “Port” box in LADB."
Click to expand...
Click to collapse
If I were to "guess" wildly - then that means what everyone wants is perhaps impossible to accomplish; but I'm still hoping that's not the case - but - the point is to find an updated XDA Developers' tutorial that shows an awareness of the stated problem set.
EDIT: I have an idea. I installed LADB on Android, and now I'm trying to see if I can query that LADB from the PC using adb commands where the goal is maybe the PC adb can query the Android ladb to figure out what the current random port assignment is???
GalaxyA325G said:
So ladb doesn't change anything... as far as I can tell (but maybe I'm wrong?).
If I were to "guess" wildly - then that means what everyone wants is perhaps impossible to accomplish; but I'm still hoping that's not the case - but - the point is to find an updated XDA Developers' tutorial that shows an awareness of the stated problem set.
EDIT: I have an idea. I installed LADB on Android, and now I'm trying to see if I can query that LADB from the PC using adb commands where the goal is maybe the PC adb can query the Android ladb to figure out what the current random port assignment is???
Click to expand...
Click to collapse
Yes .. everything you have said is correct
I wouldn't say it has any special privileges. It just guides you through the connection process.
You end up with a blank canvas in terminal - just as you would using termux
Not sure what the app costs, I purchased pre release so cost barely a thing
either way , it cuts out some of the faff and i'd certainly recommend for a less tech savvy person...
Then again.. why wouldn't anyone with no clue, use adb?
If I can assist in any way. Feel free to give me a shout on telegram
CFKod said:
Yes .. everything you have said is correct
Click to expand...
Click to collapse
I must again thank you for letting me know about local adb.
I installed ladb the instant you informed me about it.
Yesterday and today I started to test it out.
CFKod said:
It just guides you through the connection process.
Click to expand...
Click to collapse
I'm hoping maybe this ladb running on the Android device "might" give it something special that the PC doesn't have in terms of access to the information of the random port assignment on Android.
There are multiple levels of this problem set, the top level being the almost complete lack of XDA Developers' tutorials that have any cognizance of what's new in Android 11 and up with respect to adb wireless connections - where - again - I thank you for finding the one and only XDA Developers' tutorial that shows that awareness.
However, the more important level of this problem set is to find a way to connect adb wirelessly to Android WITHOUT manually grepping the random port with our eyeballs.
CFKod said:
You end up with a blank canvas in terminal - just as you would using termux
Click to expand...
Click to collapse
It may very well be that the Android developers made that impossible (e.g., for security reasons); but in the absence of any information or tutorial stating that as a fact, I'm not going to assume it's impossible (yet).
AFAICT, the way to solve the problem is to find a way to either:
a. Keep the port assignment static, or,
b. Set the port to a specific assignment (as we did with USB), or,
c. Determine the random port assignment programatically
It "may" be that local adb can help in that latter method... dunno yet... but I didn't even know ladb existed until you mentioned it so I'm starting from scratch without a tutorial (for this part of the problem set).
CFKod said:
I wouldn't say it has any special privileges.
Click to expand...
Click to collapse
Actually, after looking it up since yesterday, I think local adb DOES have more privileges than does Termux; so I was wrong in that assumption.
The ladb developer, @tytydraco said so himself on Dec 18, 2020 when he announced the existence of the ladb APK on XDA Developers.
tytydraco said:
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.
Click to expand...
Click to collapse
So we can safely assume ladb has "elevated privileges" which Termux doesn't have (which is a good thing as we may need them!).
CFKod said:
Then again.. why wouldn't anyone with no clue, use adb?
Click to expand...
Click to collapse
Well.... just as "mock location" GPS spoofing is a "Developer option" that has gone mainstream, I suspect we're at an inflection point where with screen mirroring of scrcpy and vysor, that adb usb/wireless debugging has gone mainstream too!
In summary, here's the status so far (which may change over time)...
a. Unfortunately, nobody knows of an updated XDA adb tutorial
b. But there is an updated XDA ladb tutorial
c. But even that ladb tutorial REQUIRES an eyeball grep of the random port assignment (aurgh!)
Note with the brand new Android 12 tile that it's not in the least difficult to do that eyeball grep of the current random port assignment (although you have to get up from your computer to find the phone in order to do so) - but the whole point of computers is they are supposed to do that stuff for you (are they not?).
While it may be designed that way by Google, I'm hoping I can figure out a programatic way to obtain that random port assignment from the PC, where the suggestion of perhaps implementing ladb as a middleman "might" solve that problem (if I can figure out the method).
Thanks for your help and advice, as everyone has the same adb random port assignment problem who wants to mirror their phone onto the PC completely wirelessly - and for which there is no known XDA tutorial to help them (yet).
BTW, I've noticed only recently since I started testing out ladb that the serial numbers are different where I wonder if anyone can explain why there is both a long and a short serial number when using adb completely wirelessly.
Note the question matters because "maybe" we can omit the random port if we can connect via the static serial numbers...
Adb source changes a lot, with the adb wifi stuff being added in, you could probably compile a modified adb binary to use via an apk like ladb that could use a static serial number connection method.
In source, there's a lot of testing binaries you can compile, iirc in maybe 11-dev branch there was some code commented out to allow for more insecure connections.
Hey I have noticed that shizuku also uses wireless adb...
I may have time to test it later.
Surge1223 said:
you could probably compile a modified adb binary to use via an apk like ladb that could use a static serial number connection method.
Click to expand...
Click to collapse
Thank you for that suggestion, because if it was easy to connect purely over Wi-Fi (sans USB) between adb on the PC and the Android 11+ phone (WITHOUT eyeballing the randomly assigned port address), it would have been documented already (since it's what EVERYONE wants to do).
So we're breaking new ground...
And, while I definitely harbor the optimism that there (almost always) is a way, I do agree that nobody on the Internet (that I can find) has found THAT way.
Still... as you suggested, ladb does have some extra "hooks" on the phone itself which may allow ladb to REPORT back to the PC over Wi-Fi what our EYEBALLS have to see for themselves today (of the random port address).
This report back to the PC (of the random port address) over Wi-FI has to be done in some OTHER protocol than adb itself, I suspect... as it's a chicken-and-the-egg scenario otherwise.
BTW, we "might" be able to use the Android serial number to good effect, but probably not as my tests using the Android serial number only work AFTER the adb connection has been prior established.
Code:
C:\> adb devices
*daemon not running; starting now at tcp:5555
*daemon started successfully
List of devices attached
C:\> adb devices
List of devices attached
C:\> adb devices
adb-YFVR80V7YFY-yF7kj8._adb-tls-connect._tcp. device
C:\> scrcpy -s adb-YFVR80V7YFY-yF7kj8._adb-tls-connect._tcp.
C:\> adb connect -s adb-YFVR80V7YFY-yF7kj8._adb-tls-connect._tcp.
C:\> adb connect -s 192.168.0.2
CFKod said:
Hey I have noticed that shizuku also uses wireless adb...
I may have time to test it later.
Click to expand...
Click to collapse
Thank you for that pointer to Shizuku which, like ladb, I had never heard of until you mentioned it as a possible solution.
What's nice is Shizuku has its own updated tutorial on XDA Developers which, at least, is aware of the new Android 11+ Developer options:Wireless debugging toggle, as it says...
"On Android 11 or above, you can enable Wireless debugging and start Shizuku directly from your device, without connecting to a computer."
Click to expand...
Click to collapse
By which they really mean:
"On Android 11 or above, you can enable Wireless debugging and start Shizuku directly from your device, without first needing to connect by USB to a computer."
Click to expand...
Click to collapse
I'm not rooted; but, since Shizuku can be started on the Android device, maybe it can be used to tell the computer over Wi-Fi what the current random port address assignment is (or the unencrypted adb connect command) or the random port and pin assignment (for the encrypted adb connect command).
MOD EDIT: ENGLISH TRANSLATION ADDED
I want to apply this program, Yasser, as much as possible
---------------------------------
ااريدتطبيق هذا البرنامح ياسر مايمكن
MOD EDIT: ENGLISH TRANSLATION ADDED
and not google
-----------
وغير قوقل
زين said:
MOD EDIT: ENGLISH TRANSLATION ADDED
I want to apply this program, Yasser, as much as possible
---------------------------------
ااريدتطبيق هذا البرنامح ياسر مايمكن
Click to expand...
Click to collapse
زين said:
MOD EDIT: ENGLISH TRANSLATION ADDED
and not google
-----------
وغير قوقل
Click to expand...
Click to collapse
1. This thread is a question (mostly) about a missing XDA tutorial.
2. The NEED for the tutorial is embedded in the details
Essentially...
a. We need an updated adb TUTORIAL for Android 11+ new features
b. Specifically, how to connect COMPLETELY via Wi-Fi (no USB)
Keeping in mind...
i. The OLD USE model used adb over USB first
ii. And then, after USB connection, adb could move to Wi-Fi
What we want is...
A. The Android 11+ use model is to eliminate the need for USB
B. But STILL connect using adb over Wi-Fi from the PC
Where...
A. The OLD use model was done COMPLETELY from the PC
B. And we're simply trying to REPLICATE that old use model
However... the problem is...
1. So far, we MUST first ascertain VISUALLY the random port (& PIN)
2. Which means we can no longer connect FROM the PC
That's the problem exposed by this thread, in a nutshell...
But... I do NOT understand what the two posts above are asking us to answer...
a. "I want to apply this program, Yasser, as much as possible"
b. "And not google"
Huh?
A. Which program? (adb? ladb? shizuku?)
B. Who (or what?) is Yasser?
C. And what does "not Google" have to do with it?
D. What does that poster want as an "answer"?
I want to help the guy (just as I'd want to help anyone).
But I don't understand what the heck the guy is even asking.
Can someone translate that English translation to something that makes sense in English that can be answered in English?