FORUMS
Remove All Ads from XDA
OnePlus 6 On Sale

Run a BAT File on Firestick?

65 posts
Thanks Meter: 3
 
By trizzypballr, Member on 15th May 2018, 04:09 PM
Post Reply Email Thread
Is it possible to run a Batch File on a Firestick? Trying to help people set their firesticks up and, I have written a Batch file using ADB that works well loading programs onto a firestick and installing them. That only works if someone is on my local network though. If I push all of the files to someone including the batch file, would you be able to run the batch file on a firestick?
 
 
15th May 2018, 06:07 PM |#2  
Senior Member
Flag Sunderland
Thanks Meter: 144
 
More
Quote:
Originally Posted by trizzypballr

Is it possible to run a Batch File on a Firestick? Trying to help people set their firesticks up and, I have written a Batch file using ADB that works well loading programs onto a firestick and installing them. That only works if someone is on my local network though. If I push all of the files to someone including the batch file, would you be able to run the batch file on a firestick?

i have a firestick that i need setup and was going to do it over this weekend, if you can send me the stuff i can test
16th May 2018, 12:04 AM |#3  
Junior Member
Flag Jacksonville
Thanks Meter: 3
 
More
Batch files are for Windows only.
The easiest way to do this would be to put all your apks into a folder, along with the adb.exe, AdbWinApi.dll, and your batch file.
Have them enable ADB on their stick, and give them the folder. Here's an example of a batch file that would make it dead simple:
Code:
@echo off
set /p ip="Enter Fire TV IP: "
adb connect %ip%
adb install apks\example.apk
<other code here>
adb disconnect
This would be the example file tree:
Code:
|   adb.exe
|   AdbWinApi.dll
|   example.bat
|
\---apks
        example.apk
Then give this folder to the person
16th May 2018, 09:29 AM |#4  
rainman74's Avatar
Senior Member
Flag Munich
Thanks Meter: 107
 
More
Quote:
Originally Posted by trizzypballr

Is it possible to run a Batch File on a Firestick? Trying to help people set their firesticks up and, I have written a Batch file using ADB that works well loading programs onto a firestick and installing them. That only works if someone is on my local network though. If I push all of the files to someone including the batch file, would you be able to run the batch file on a firestick?

You can run any shell script on a Fire TV: A First Script
16th May 2018, 04:07 PM |#5  
OP Member
Thanks Meter: 3
 
More
Quote:
Originally Posted by rainman74

You can run any shell script on a Fire TV: A First Script

Are we able to use ADB commands on a shell script on a firestick? Looking at a gethub .sh file for use on firesticks it looks like they are?

For simplicity sake here is a scaled down version of the goal. I want to put kodi.apk and terrarium.apk onto their firestick for them. I want to be able to connect via teamviewer and push a folder over that contains:
kodi.apk
terrarium.apk
a shell file

The goal is that either the shell file is triggered somehow or the person with the firestick in front of them runs it and it does the equivalent of what I can do from my computer with the batch file using:
adb install "kodi.apk"
adb install "terrarium.apk"

I tried googling shell script on a firestick and didnt have any luck besides finding the github of a firestick loader that i searched through.
16th May 2018, 04:12 PM |#6  
rainman74's Avatar
Senior Member
Flag Munich
Thanks Meter: 107
 
More
Quote:
Originally Posted by trizzypballr

Are we able to use ADB commands on a shell script on a firestick? Looking at a gethub .sh file for use on firesticks it looks like they are?

For simplicity sake here is a scaled down version of the goal. I want to put kodi.apk and terrarium.apk onto their firestick for them. I want to be able to connect via teamviewer and push a folder over that contains:
kodi.apk
terrarium.apk
a shell file

The goal is that either the shell file is triggered somehow or the person with the firestick in front of them runs it and it does the equivalent of what I can do from my computer with the batch file using:
adb install "kodi.apk"
adb install "terrarium.apk"

I tried googling shell script on a firestick and didnt have any luck besides finding the github of a firestick loader that i searched through.

You don't need adb for that, I'll write you a script example later...

By the way, you could also execute adb commands if you reinstalled adb before (Amazon deliberately removed this). Do you have root rights on the sticks?
16th May 2018, 04:14 PM |#7  
OP Member
Thanks Meter: 3
 
More
Quote:
Originally Posted by rainman74

You don't need adb for that, I'll write you a script example later...

By the way, you could also execute adb commands if you reinstalled adb before (Amazon deliberately removed this). Do you have root rights on the sticks?

No the sticks are not rooted
16th May 2018, 05:26 PM |#8  
rainman74's Avatar
Senior Member
Flag Munich
Thanks Meter: 107
 
More
Quote:
Originally Posted by trizzypballr

No the sticks are not rooted

ok, here is the example, that you can customize.

Code:
#!/bin/sh

pm install /sdcard/kodi.apk
pm install /sdcard/terrarium.apk
You have to save the sh file in Unix format (linefeed as line ends). The easiest way is to save it in Notepad++ as a Unix script file.
16th May 2018, 07:19 PM |#9  
OP Member
Thanks Meter: 3
 
More
Quote:
Originally Posted by rainman74

ok, here is the example, that you can customize.

Code:
#!/bin/sh

pm install /sdcard/kodi.apk
pm install /sdcard/terrarium.apk
You have to save the sh file in Unix format (linefeed as line ends). The easiest way is to save it in Notepad++ as a Unix script file.

I tried saving as .sh and also as .bash . The firestick gave the message that there is no program to run it. How can I make this runnable on a firestick
16th May 2018, 07:35 PM |#10  
rainman74's Avatar
Senior Member
Flag Munich
Thanks Meter: 107
 
More
Quote:
Originally Posted by trizzypballr

I tried saving as .sh and also as .bash . The firestick gave the message that there is no program to run it. How can I make this runnable on a firestick

Code:
sh file.sh
or

Code:
chmod 755 file.sh
to make the text file executable, and then run

Code:
./file.sh
Google isn't your friend, is it?
16th May 2018, 07:48 PM |#11  
OP Member
Thanks Meter: 3
 
More
Quote:
Originally Posted by rainman74

Code:
sh file.sh
or

Code:
chmod 755 file.sh
to make the text file executable, and then run

Code:
./file.sh
Google isn't your friend, is it?

I did try to google but didnt google the correct thing apparently I tried Googling "how to run Unix File on Firestick" and a few variations of it with no luck. I appreciate all of your help though for sure!

Trying to figure out where to run this on the firestick, after googling it, it seems like I need to get to a command code somehow to run this? I was hoping it was executable. Can I make it executable on my computer and then when I push it to the firestick just click on it and it runs?
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes