• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

[APP][NO ROOT] ADB on Boot | Run adb commands at boot automatically

Search This thread

Shaikh Amaan FM

Senior Member
Oct 30, 2016
63
24
Mumbai
How to use?

1. Enable ADB Debugging from Fire TV settings
2. In this app, add the adb commands that you want to execute on every boot
3. Set whether you want to display a Toast message on completion of command execution
4. Test the script if you want by pressing "Test Script" button.
5. Apply the configs by pressing the apply button.

Support the work by purchasing it from here

Note: when you run this app for the first time, you should press the test script button, so that app can acquire adb permission. If you don't do this, then the adb permission prompt would appear when you boot the stick for the first time, after installing and opening this app.
That's all

Also note that, the commands you'll write here should be without "adb shell" prefix.
For example,
you have to write
echo "Hello World"
and not
adb shell echo "Hello World"

PicsArt_11-29-01.08.46.jpg

(or multiple commands separated by semi-colon ' ; ' )

PicsArt_11-29-01.11.27.jpg

PicsArt_11-29-01.14.03.jpg
 

Attachments

  • adb_on_boot-asfm.apk
    2.1 MB · Views: 47
Last edited:

Spamm00r

Senior Member
Nov 21, 2011
65
5
Yes you can add multiple commands with ; and add a delay using sleep command.

Example,

sleep 3; echo "I'm here after 3 seconds";
Perfect!

Did you test wether you can use this app to issue "adb tcpip 5555" command at bot so that the adb wifi tasker function can do the rest? Thatway we would have adb shell on a non rooted device all the time.
 
Last edited:

Shaikh Amaan FM

Senior Member
Oct 30, 2016
63
24
Mumbai
Perfect!

Did you test wether you can use this app to issue "adb tcpip 5555" command at bot so that the adb wifi tasker function can do the rest? Thatway we would have adb shell on a non rooted device all the time.

The issue with Tasker is something else as far as I can see. May be because Tasker have subscription checking thing in it and it needs Google Libraries which are not available in fire os.
 
  • Like
Reactions: Sus_i

Spamm00r

Senior Member
Nov 21, 2011
65
5
So I finally was able to test this. The app does work ok.

I'd like to be able to execute these scripts not only at boot. For example like when you press test script, I'd like to be able to run the app anytime I want the script to execute.

Can you please also add an setting that allows the scripts to be executed by just opening the app, so that you are not limited to run these scripts only at boot or when you manually press " test script". So we could use these scripts anytime we run this app for example via Tasker.

Why does the shell execution work with this app but not with taskers adb shell?
 
Last edited:

Shaikh Amaan FM

Senior Member
Oct 30, 2016
63
24
Mumbai
So I finally was able to test this. The app does work ok.

I'd like to be able to execute these scripts not only at boot. For example like when you press test script, I'd like to be able to run the app anytime I want the script to execute.

Can you please also add an setting that allows the scripts to be executed by just opening the app, so that you are not limited to run these scripts only at boot or when you manually press " test script". So we could use these scripts anytime we run this app for example via Tasker.

Why does the shell execution work with this app but not with taskers adb shell?
Are you able to use Tasker in the stick?
I tried in my device and it won't even show a simple Toast and possible reason as I said is that Tasker have subscription checking thing in it and that requires Play services which are missing in Fire OS. So unless you have direct purchased version of Tasker or unless you install Play services in it, I don't see any good way of running Tasker in it.
 

Spamm00r

Senior Member
Nov 21, 2011
65
5
Are you able to use Tasker in the stick?
I tried in my device and it won't even show a simple Toast and possible reason as I said is that Tasker have subscription checking thing in it and that requires Play services which are missing in Fire OS. So unless you have direct purchased version of Tasker or unless you install Play services in it, I don't see any good way of running Tasker in it.
Yes I have Tasker running on FireTV 4K without play service. You can download an apk with 7 day trial directly from the tasker website and it works without playstore. If it has issues with subscription or trial expired, it will tell so and refuse to execute some advanced features.

I can run intents and stuff with tasker just fine, but as Fire TV has no Accessibility service installed, you can not use most of the nice features and plugins of Tasker. Issuing shell commands for example does not work. so I can not issue any keyinput with tasker. That's why I have to rely on your app.

With your app however I was able to completely avoid tasker for now.

I used Tasker to run an intent that opens a youtube link. Now I run this intent from your app. Also i can now issue keyinput with your app. With Tasker that was not possible due to missing accessibility service, which Tasker relies on.

How is your app able to issue keyinput via shell, while tasker can not due to mssing accessibility services? Maybe you can make your app more advanced and allow it to be used as a proxy for issuing shell keyinput on devices without accessibility service. This is the one single reason why I wish i had root on this device. Just to have accessibility service back, which Amazon removed in the recent firmware versions.

I use input to press home key, which makes Fire TV switch the HDMI input of the TV to itself. Now Whenever I start the tv, Fire TV automatically switches input to itself and starts playing youtube.

What I now also want is to be able to use your app also after boot, as I need to switch input and issue keyinput after boot while running several times. Thats why I asked you to add an option to runn it also after boot.
Because if I press "test script" keyinput also works with your app. But not with Tasker.

Will it work, if I open your app with intent "android.intent.action.MAIN"? Will it execute the shell script like when at boot? if yes, then I will try to run this intent from Tasker.

Also It would be good if it was possible to have multiple scripts that you can execute so that you are not stuck with one single script. For example allow to save script a, b, c etc, and then have an intent to be ebale to run a specific script a, b or c. etc..

Your script is very helpful and solves a big problems that amazon has introduced by cutting accesisbility service. Without your app, fire tv would be so useless for me. Thanks for releasing it.
 
Last edited:

Shaikh Amaan FM

Senior Member
Oct 30, 2016
63
24
Mumbai
What I now also want is to be able to use your app also after boot, as I need to switch input and issue keyinput after boot while running several times. Thats why I asked you to add an option to runn it also after boot.
Because if I press "test script" keyinput also works with your app. But not with Tasker.

Yes this can be done, but i'm busy in something else, so it might take a while

Also It would be good if it was possible to have multiple scripts that you can execute so that you are not stuck with one single script.

For having multiple scripts, currently I think you can do it by creating different bash files containing scripts and store them somewhere in Fire Device's storage and then execute them (but probably you'll face problem in giving execute permission to those bash files), this process can be made easier but as I said would take time.
 

Spamm00r

Senior Member
Nov 21, 2011
65
5
Yes this can be done, but i'm busy in something else, so it might take a while



For having multiple scripts, currently I think you can do it by creating different bash files containing scripts and store them somewhere in Fire Device's storage and then execute them (but probably you'll face problem in giving execute permission to those bash files), this process can be made easier but as I said would take time.
OK no problem. Take your time.

I don't think that you can execute scripts without root. How does your app execute these scripts without root permissions?

Also sometimes the script is not executed, not at boot and not when I press "test script". I think maybe adb is being blocked by some other app? I have to look into why this happens.
 

Shaikh Amaan FM

Senior Member
Oct 30, 2016
63
24
Mumbai
OK no problem. Take your time.

I don't think that you can execute scripts without root. How does your app execute these scripts without root permissions?

Also sometimes the script is not executed, not at boot and not when I press "test script". I think maybe adb is being blocked by some other app? I have to look into why this happens.
Which fire device do you have and what's the Fire OS version in it. App doesn't works in Fire OS 5, in Fire OS 6, you have to make sure that no other device/service is connected to ADB, In Fire OS 7, I didn't saw any issue
 

Spamm00r

Senior Member
Nov 21, 2011
65
5
Which fire device do you have and what's the Fire OS version in it. App doesn't works in Fire OS 5, in Fire OS 6, you have to make sure that no other device/service is connected to ADB, In Fire OS 7, I didn't saw any issue
I have Fire TV Stick 4k and OS is 6. I figured out why it sometimes doe snot work. it is because ADB is occupied by another app. If I disable and enable adb debugging and thatway break any exisiting connections, it works fine. I just have to make sure that no other app blocks adb, as apparently only 1 app can be connected to adb at a time.

That might be another point of improvement, to make sure that adb is not left occupied.
 

Shaikh Amaan FM

Senior Member
Oct 30, 2016
63
24
Mumbai
I have Fire TV Stick 4k and OS is 6. I figured out why it sometimes doe snot work. it is because ADB is occupied by another app. If I disable and enable adb debugging and thatway break any exisiting connections, it works fine. I just have to make sure that no other app blocks adb, as apparently only 1 app can be connected to adb at a time.

That might be another point of improvement, to make sure that adb is not left occupied.
In fire os 7, there's no such issue. But yeah in fire os 6 I have tested, only one service or device can connect to adb at a time, and I don't think there's anything I can do about it
 

Spamm00r

Senior Member
Nov 21, 2011
65
5
In fire os 7, there's no such issue. But yeah in fire os 6 I have tested, only one service or device can connect to adb at a time, and I don't think there's anything I can do about it
My exact Fire OS is: Fire OS 6.2.8.1

WHich Fire TV Stick has OS 7?
Being able to connect multiple clients to adb is a big step forward. Right now I have to manually toggle adb access to allow other tools to connect to adb. This is a big problem.
 

Shaikh Amaan FM

Senior Member
Oct 30, 2016
63
24
Mumbai
My exact Fire OS is: Fire OS 6.2.8.1

WHich Fire TV Stick has OS 7?
Being able to connect multiple clients to adb is a big step forward. Right now I have to manually toggle adb access to allow other tools to connect to adb. This is a big problem.
I have Fire Stick 3rd gen.
New devices including Fire Stick Lite are running Fire OS 7.x and I can connect multiple different devices/services to adb at the same time without any issue.
 

Spamm00r

Senior Member
Nov 21, 2011
65
5
Curious that the Lite has newer Fire OS Version than man other devices. In this case it would be desirable to update, but until then how can make sure that your app or any other app disconnects form adb and gives it free to use for other applications.

Right now I have to manually go to developer settings and toggle ADB off and on to make it available to other apps. Otherwise, adb will be occupied by the last app that used it.

Is it possible to automate this? Adding "disconnect" to the shell command didn't help.
 

Shaikh Amaan FM

Senior Member
Oct 30, 2016
63
24
Mumbai
Curious that the Lite has newer Fire OS Version than man other devices. In this case it would be desirable to update, but until then how can make sure that your app or any other app disconnects form adb and gives it free to use for other applications.

Right now I have to manually go to developer settings and toggle ADB off and on to make it available to other apps. Otherwise, adb will be occupied by the last app that used it.

Is it possible to automate this? Adding "disconnect" to the shell command didn't help.
Look for force stopping the application through adb commands.
 

Spamm00r

Senior Member
Nov 21, 2011
65
5
I have managed to make the app start also after boot via Taskers app action. But the script is only executed after manually pressing the "test Script" button.

What exact intent action is executed by pressing the "Test Script" button? From the xml file I can only see "com.asfmapps.firetv_adbonboot.MainActivity".

I have also tried to send android.intent.action.BOOT_COMPLETED to your app to make it think it just started up but that also does not make your app to execute the script automatically.

What intent is your app listening for to execute the script? And ho do I issue it via shell or tasker?
 

Top Liked Posts

  • There are no posts matching your filters.
  • 4
    How to use?

    1. Enable ADB Debugging from Fire TV settings
    2. In this app, add the adb commands that you want to execute on every boot
    3. Set whether you want to display a Toast message on completion of command execution
    4. Test the script if you want by pressing "Test Script" button.
    5. Apply the configs by pressing the apply button.

    Support the work by purchasing it from here

    Note: when you run this app for the first time, you should press the test script button, so that app can acquire adb permission. If you don't do this, then the adb permission prompt would appear when you boot the stick for the first time, after installing and opening this app.
    That's all

    Also note that, the commands you'll write here should be without "adb shell" prefix.
    For example,
    you have to write
    echo "Hello World"
    and not
    adb shell echo "Hello World"

    PicsArt_11-29-01.08.46.jpg

    (or multiple commands separated by semi-colon ' ; ' )

    PicsArt_11-29-01.11.27.jpg

    PicsArt_11-29-01.14.03.jpg
    1
    Perfect!

    Did you test wether you can use this app to issue "adb tcpip 5555" command at bot so that the adb wifi tasker function can do the rest? Thatway we would have adb shell on a non rooted device all the time.

    The issue with Tasker is something else as far as I can see. May be because Tasker have subscription checking thing in it and it needs Google Libraries which are not available in fire os.