Search code examples
androidbatch-fileadb

ADB Batch Script


I really need some help with my syntax and getting this to run right. So im trying to automate an entire kodi, and llama install just by entering your ip into a batch file. Any assistance would be much appreciated.

cls
echo.
echo You will install an app
echo The app need to be in your ADB-Folder
echo Before you hit enter INSTALL "iKoNo"" on your FireTV
echo.
pause

echo.
echo You can find your IP by going to Settings > About > Network on your   device
set /p ip=Enter the IP of your FireTV or FireTVStick:

adb kill-server
adb connect 192.168.137.%ip%
adb install "%UserProfile%\Desktop\FireTV\kodi.apk"
adb install "%UserProfile%\Desktop\FireTV\settings.apk"
adb install "%UserProfile%\Desktop\FireTV\llama.apk"

adb push "%UserProfile%\Desktop\FireTV\busybox" /data/local/tmp/
adb shell chmod 755 /data/local/tmp/busybox
adb shell "%UserProfile%\Desktop\FireTV\busybox" --install -s /data/local/tmp
adb push "%UserProfile%\Desktop\FireTV\adbfw128\events\llamakodi\linkiko" /sdcard/Llama/
adb push "%UserProfile%\Desktop\FireTV\adbfw128\events\llamakodi\linkiko\Llama_Profiles.txt" -> /sdcard/Llama/Llama_Profiles.txt
adb push "%UserProfile%\Desktop\FireTV\adbfw128\events\llamakodi\linkiko\Llama_NfcNames.txt" -> /sdcard/Llama/Llama_NfcNames.txt
adb push "%UserProfile%\Desktop\FireTV\adbfw128\events\llamakodi\linkiko\Llama_IgnoredCells.txt" -> /sdcard/Llama/Llama_IgnoredCells.txt
adb push "%UserProfile%\Desktop\FireTV\adbfw128\events\llamakodi\linkiko\Llama_Events.txt" -> /sdcard/Llama/Llama_Events.txt
adb push "%UserProfile%\Desktop\FireTV\adbfw128\events\llamakodi\linkiko\Llama_Areas.txt" -> /sdcard/Llama/Llama_Areas.txt

adb shell rm -r /sdcard/.imagecache/com.amazon.venezia/org.ikonotv.smarttv
adb shell mkdir -p /sdcard/.imagecache/com.amazon.venezia/org.ikonotv.smarttv
adb push "%UserProfile%\Desktop\FireTV\adbfw128\icons\ikokodi.icon" /sdcard/.imagecache/com.amazon.venezia/org.ikonotv.smarttv
adb push "%UserProfile%\Desktop\FireTV\adbfw128\icons\ikokodi.icon\B00NEJS7ZO\thumbnail_bfc0289736b3b0fbd3e32dec9d5d44c9dbe7cef5a082645ab0af157c6f3f600b.png" -> /sdcard/.imagecache/com.amazon.venezia/org.ikonotv.smarttv/B00NEJS7ZO/thumbnail_bfc0289736b3b0fbd3e32dec9d5d44c9dbe7cef5a082645ab0af157c6f3f600b.png
adb push "%UserProfile%\Desktop\FireTV\adbfw128\icons\icons\ikokodi.icon\B00NEJS7ZO\preview_5dd7e33b605bec171c4bba546e5b35c783feb32a53c44227249ad52f653dc49c.png" -> /sdcard/.imagecache/com.amazon.venezia/org.ikonotv.smarttv/B00NEJS7ZO/preview_5dd7e33b605bec171c4bba546e5b35c783feb32a53c44227249ad52f653dc49c.png
adb kill-server


echo.
echo Done!

for some reason its not working right im trying to use the same process adbfire does!

In this code --> https://github.com/Jocala/adbFire/blob/master/mainwindow.cpp


Solution

  • The > symbols in your batch file are interpreted by CMD.exe as redirection of output to a file. Escape them with ^ so each -> should be written as -^> if you need this symbol passed as a parameter.

    However ADB PUSH local_file remote_file syntax doesn't require use of these symbols, so just don't use -> at all.