2
Completed

"send Adb Shell Command over the TcpIp" action

 we all know we can use "adb tcpip 5555" to open adbd, and then use "abd connect xxx.xxx.xxx.xxx:5555"  to send adb command remotely. But we could also send command to "127.0.0.1:5555"  on our phone it self.  

On some devices, we may don't have root permission, and Tasker Shell Code action permission is greatly restricted, some commands such as "sendevent"  could not be performed. But if we use tcpip adb port to send the command, the phone wouldbthink it as a computer sending adb commands, and perform the command. 

Once the function is added, all we have to do is connect to the computer and run "adb tcpip 5555" , and pull out the cable, now you have the full adb permission! you can send every adb command ON YOUR PHONE TO ITSELF! 

I know there is a pluhin could do this work, but on some devices, this app is easily gets killed and wont recieve mesdage to send command, so it would be much more reliable if tasker could add this action.  

And also, there is open source lib could be used to add this function. https://github.com/cgutman/AdbLib

3 replies

F

Yay! Thanks a lot!! :) 

Ok, this makes sense. Will implement!

Hi, thanks for the suggestion! That's interesting indeed :)

Correct me if I'm wrong though, if this were implemented every time you restarted your phone this would stop working, right?

F

Yes, that's correct. Every time you reboot the phone, you have to connect to a PC again and run the "adb tcpip 5555" command again. Otherwise, it won't execute the commands.

I use the mentioned plugin for years now and it's very handy. The name of the plugin is "ADB Shell [Tasker Plugin]", here's the link: https://play.google.com/store/apps/details?id=com.ADBPlugin 

The developer is still active, he just pushed an update a few days ago.

I'm a heavy user of this plugin since I stopped rooting my devices. It opens up a whole new world of commands which are not available otherwise (on a non-rooted device), like toggle mobile data on/off or simulating power button press (so the screen turns off and you're still able to unlock it via fingerprint afterwards).

But unfortunately, every now and then, it refuses to work. And with every update, I had to raise the time out value of the plugin action so it would start working again.

I assume it would run more reliable and faster if it was a native Tasker function.

Ok, will add! Thanks for the clarification! :)