• ADB Shell [Tasker Plugin] 1
  • ADB Shell [Tasker Plugin] 2

ADB Shell [Tasker Plugin]

This Tasker plugin allows you to send a (series of) ADB Shell command(s) to a remote device (or the device itself) that has ADB over WiFi enabled.
This app obviously does need Tasker to work as it's a plugin (https://play.google.com/store/apps/details?id=net.dinglisch.android.taskerm, this is a paid app with a 7 days free trial). Again, without Tasker it WON'T WORK. Was I clear enough? Anyways...

On the target device you can do anything you would normally be able to do when using the terminal or ADB Shell of that device. This includes opening apps, moving files, simulating input et cetera (The sky is the limit and Google is your friend).

My app can be used as an action in Tasker and needs to be configured properly when added to a task to work.

NOTE:
- You can send multiple commands at once by separating them with a ";".
- All commands in a single action are automatically followed with an "exit" command so to close the ADB connection. This means that if you want to send multiple commands that are depending on each other, you will need to put them in a single Tasker action and separate them with ";".
- If you want multiple actions of my plugin to run after each other in a Tasker task, please keep the timeout set as is. Tasker will continue when the command is sent.
- The first time you try to connect to another device via ADB it will ask you if you trust the device. For this plugin to work correctly, you'll need to always "trust this computer".
- The output of the console can be viewed and reused from within Tasker. This can be done by accessing %output1, %output2 etc. or by iteration over %output() using a for loop.
- The plugin will generate two key files on your device to be able to make a secure ADB connection to the devices.

Now for some useful commands!
- A command I myself use a lot is to turn my ADB over WiFi enabled AndroidTV (Nvidia SHIELD) on or off by sending the command "input keyevent POWER", this simulates a power button press.
- Of course you can vary which key to press, for example to press the arrow keys you can do "input keyevent DPAD_RIGHT" or “…LEFT” etc.
- Another simple command is "reboot", which will, you guessed it, reboot the device! You can also put "reboot -p" here to power it down.
- A cool thing to be able to do is to launch apps on the device. You will have to Google a bit to find the Main activity of an app. This example will open Chrome on the device: "am start -n com.android.chrome/com.google.android.apps.chrome.Main".
- When you fill in “localhost” in the IP address field, every command will be executed on the device itself! This works even without root if you, of course, have ADB over WiFi enabled (can be activated from a pc using “adb tcpip 5555”).
Of course there are many other commands, the sky is the limit!
This is my first ever published app, so please leave feedback and submit bugs so I can try my best to fix them! Any tips are more than welcome!

The idea to create this app came from https://play.google.com/store/apps/details?id=com.cgutman.androidremotedebugger, which allows the user to connect to a remote device via an interface in the app itself. Please read the description of that app too, it contains some tips on enabling ADB over WiFi. I use the same AdbLib Java library in my app.

I use the AdbLib library found at https://github.com/cgutman/AdbLib and use https://github.com/cgutman/AdbLibTest as an example for how to use the library. I adapted this example to work with a given command and converted it to a Tasker plugin.

For help, you can email me or visit the XDA-Developers thread at https://forum.xda-developers.com/u/tasker-tips-tricks/plugin-remote-adb-shell-t3562013. This thread also contains some useful tips for accessing the local device running the task without root.

Now open source at https://github.com/Jolanrensen/ADBPlugin!

Category : Tools

Related searches

Reviews (17)

Soe. F. Oct 30, 2018     

Nice clean update! Strangely I had to edit and save every command again, otherwise it would throw an exception "integer cannot be cast to string". (So I suspect the port variable.)

Rya. A. Apr 1, 2021     

This was the app that makes everything run smooth on my phone. This app and my phone (computer) are a match made in heaven. I must have more. Perfect!!!

Sco. W. Oct 13, 2020     

Trying to send a keyevent to an android tv device doesn't work. Command works from computer but not with this. Input keyevent 164 50ms. Mute/unmute

n. h. Jan 5, 2020     

Plugin works great to enable mousetoggle on Fire TV devices that are hung in a "starting" state. thx (more details on XDA)

ALE. Y. Oct 27, 2020     

Hi I'm new to this app. Can you tell what I can do with this app? Like how to activate ADB tcpip 5555 from this app without connect cable to a pc? Thanks

Tem. Y. J. Mar 5, 2021     

Just happen to come across this and dunno what it is, but I feel like it deserves more stars

W. G. Aug 15, 2019     

great plugin that helps me manage my tablets

A. G. u. Dec 23, 2018     

cant run to test before buying.

Adi. R. Jul 24, 2019     

Waste of time...

Sou. R. Feb 22, 2020     

Total 0

Jef. E. Dec 25, 2018     

still learning

Sey. H. K. Feb 27, 2019     

Love it

Ser. v. H. Dec 9, 2017     

Excellent app but I'd like to issue the full commands myself instead of entering the words after "adb shell" Can't seem to get the command "adb shell wm density" to work. Can this app issue all adb commands? Ps. I tried the density command from a normal adb console and that worked.

Poo. A. Feb 9, 2018     

After looking for hours to find a way to run shell commands locally without root, I found the tricky solution here! Great job! I used it for input commands and worked every time.

Mat. S. Jan 2, 2018     

Latest version, can run shell commands one initial time then cannot run again.

Ric. B. Aug 20, 2017     

It works the first time I send a command to my fire TV, but it kills the adb on the TV and I have to turn it off and on again in device settings. Anything I'm missing? United this is fixed I can't use it :(

Jar. H. Apr 1, 2017     

Very helpful app. Was successful in launching into Netflix on my Shield TV via an associated Task in Tasker on a remote tablet