Setting Android TV's default launcher via ADB problem - Android TV General

After setting the new GoogleTV Launcher as default via ADB using the command
Code:
adb shell cmd package set-home-activity "com.google.android.apps.tv.launcherx"
on my Android TV Box, checking the default launcher (always via ADB) using two different methods the shell returns a mismatching result as you can see below, and in practice the manufacturer's own launcher (timvision.launcher) always opens as default. Any suggestions? Thanks in advance.
Code:
m393gena_tim:/ $ cmd package resolve-activity -c android.intent.category.HOME
priority=2 preferredOrder=0 match=0x108000 specificIndex=-1 isDefault=true
ActivityInfo:
name=timvision.launcher.ui.HomeActivity
packageName=timvision.launcher
labelRes=0x7f110056 nonLocalizedLabel=null icon=0x7f0801e8 banner=0x7f0801e8
enabled=true exported=true directBootAware=false
taskAffinity=timvision.launcher targetActivity=null persistableMode=PERSIST_ROOT_ONLY
launchMode=3 flags=0x300220 privateFlags=0x0 theme=0x0
screenOrientation=0 configChanges=0x33 softInputMode=0x0
lockTaskLaunchMode=LOCK_TASK_LAUNCH_MODE_DEFAULT
resizeMode=RESIZE_MODE_UNRESIZEABLE
ApplicationInfo:
name=timvision.launcher.TimLauncher
packageName=timvision.launcher
labelRes=0x7f110056 nonLocalizedLabel=null icon=0x7f0e0000 banner=0x0
className=timvision.launcher.TimLauncher
processName=timvision.launcher
taskAffinity=timvision.launcher
uid=10028 flags=0x28d83ec5 privateFlags=0xc000918 theme=0x7f120013
requiresSmallestWidthDp=0 compatibleWidthLimitDp=0 largestWidthLimitDp=0
sourceDir=/data/app/timvision.launcher-_GWEhSuSRLHmn1MVNH9JyQ==/base.apk
seinfo=default:privapp:targetSdkVersion=29
seinfoUser=:complete
dataDir=/data/user/0/timvision.launcher
deviceProtectedDataDir=/data/user_de/0/timvision.launcher
credentialProtectedDataDir=/data/user/0/timvision.launcher
enabled=true minSdkVersion=26 targetSdkVersion=29 versionCode=1216031 targetSandboxVersion=1
supportsRtl=true
fullBackupContent=true
HiddenApiEnforcementPolicy=2
usesNonSdkApi=false
allowsPlaybackCapture=true
m393gena_tim:/ $ cmd shortcut get-default-launcher
Launcher: ComponentInfo{com.google.android.apps.tv.launcherx/com.google.android.apps.tv.launcherx.home.HomeActivity}
Success
m393gena_tim:/ $

Are you sure this is the proper activity: com.google.android.apps.tv.launcherx
That is only the package name. Usualy there is com.google.android.apps.tv.launcherx/......
Use: dumpsys package com.google.android.apps.tv.launcherx
and find the proper HOME activity for the package and set that using cmd package set-home-activity
Check with: cmd shortcut get-default-launcher

tweakradje said:
Are you sure this is the proper activity: com.google.android.apps.tv.launcherx
That is only the package name. Usualy there is com.google.android.apps.tv.launcherx/......
Use: dumpsys package com.google.android.apps.tv.launcherx
and find the proper HOME activity for the package and set that using cmd package set-home-activity
Check with: cmd shortcut get-default-launcher
Click to expand...
Click to collapse
Hi, thank you for your help, but I have already tried this method and nothing has changed, I can’t figure out why.

Related

Adb commands for beginners

ADB COMMANDS
This is just a simple guide on how to open up and run adb commands from your windows based operating system.
Open up run by simultaneously pressing the windows flag key and r.
In the window that pops up type cmd. Now command prompt is open
type the commands each followed by the enter key: cd\
cd androidsdk/tools
Now your in your in your androidsdk/tools folder. You can do several things in here but i'll start with some basics each
of the following commands is to be followed by the enter key
adb devices (this lets you know what devices are attached to the computer in usbdebugging)
How to get your logcat (this will put your logcat in txt format in your sdk tools folder)
adb logcat > logcat.txt
copy an app from your phone to your computer
adb pull /system/app/whatever.apk C:\ateam (replace whatever.apk with the app your pulling also replace ateam with the
folder your placing the app in
Install an app from your computer on your phone
adb install whatever.apk (put an apk in your sdk tools and replace"whatever" with the name of the apk and it will install it)
also you can add either -r or -s to reinstall or install on the sdcard for instance: adb install -r Rosie.apk
this command will reinstall the new rosie from your tools file and still keep the same user data as before.
-r for reinstall
-s for sdcard (gotta test this)
Push an app from your computer to your phones filesystem (in some cases also installs)
adb remount
adb push whatever.apk /system/app (put an apk in your sdk tools and replace "whatever" with the name of the apk and this
will push it to your system app folder. You can change the destination as well for example: You want to push Launcher2.apk
to your data/app folder: adb remount
adb push Launcher2.apk /data/app )
Remove an app from your phone
adb remount
adb shell
cd /system/app (this will change your disk to system/app you may also change to another folder as well)
ls -a ( a list will show of all the apps inside your system app folder)
rm whatever.* (replace the whatever.* with the name of a apk you want to remove )
Flash a recovery image to your phone
First pace the recovery image in your sdcard root and rename it to recovery (so the full name will now be recovery.img)
adb shell
flash_image recovery /sdcard/recovery.img (wait till this# sign shows up again before you type the next command)
reboot recovery
get your current battery level
adb shell cat /sys/class/power_supply/battery/capacity
get your current rom build
adb shell getprop ro.build.description
Reboot into fastboot ruu
adb shell reboot oem-78
How to run the ruu via adb
First thing first start the ruu give it permissions and so fourth
When it gets to the part where it says "Follow the instructons below..."
Move the ruu window out of the way and start your task manager
Go to processes right click on ARUWizard.exe and choose open file location
A new window will open scroll till you see ROM.zip
Copy and paste Rom.zip to your desktop
Once you have copied it to your desktop shutdown the ruu and task manager
Click start menu then click computer
A window will open up click the c drive
now click create new folder and name it test
put the rom.zip in the test folder
plug your phone in and open command prompt and type
Code:
adb devices
adb shell reboot oem-78
fastboot devices
fastboot getvar boot-mode
fastboot erase cache
fastboot flashzip C:\test\rom.zip
fastboot devices
fastboot getvar boot-mode
fastboot reboot
Very useful man thanks for the guide. I also think newbies would use this guide as its in the right catagory and not in some G1 section or Mt3g section.
Edit** isnt this already in the tuorials section?
sandboxlove said:
i think its a great idea, we need a more compilied list to refer to
add more!!!!
Click to expand...
Click to collapse
I'm going to try to add one everyday. tomorrows lesson how to run the ruu from adb
Powers16 said:
Very useful man thanks for the guide. I also think newbies would use this guide as its in the right catagory and not in some G1 section or Mt3g section.
Edit** isnt this already in the tuorials section?
Click to expand...
Click to collapse
Where? Pagelink
http://forum.xda-developers.com/showthread.php?p=5799939#post5799939
but its a less in depth reference so i hope this gets added into the tutorial section as here are no in depth tuts about adb in there..
also to remove apk
adb shell rm /system/ (then put in either app or media or what ever folder name /whatever.apk
Papa Smurf151 said:
also to remove apk
adb shell rm -r /system/ (then put in either app or media or what ever folder name /whatever.apk
Click to expand...
Click to collapse
rm -r is a recursive deletion and can have a lot of unwanted and harmful side-effects if used incorrectly. To just remove apks, a simple rm works just fine. If they typed the wrong directory, file name, whatever, a recursive deletion would clear the entire folder... Not really something you'd want.
This is great, I will be coming back for more.
Thanks a lot
DevinXtreme said:
rm -r is a recursive deletion and can have a lot of unwanted and harmful side-effects if used incorrectly. To just remove apks, a simple rm works just fine. If they typed the wrong directory, file name, whatever, a recursive deletion would clear the entire folder... Not really something you'd want.
Click to expand...
Click to collapse
thanks...i knew that but wasnt paying attention. I just copied and pasted from my adb notepad file. i edited my post and removed the -r
DevinXtreme said:
rm -r is a recursive deletion and can have a lot of unwanted and harmful side-effects if used incorrectly. To just remove apks, a simple rm works just fine. If they typed the wrong directory, file name, whatever, a recursive deletion would clear the entire folder... Not really something you'd want.
Click to expand...
Click to collapse
LOL, yeah, I've done that
Might want to also include a note that says when using linux or mac shell you replace the "adb" with "./adb" (I believe that is correct or at least what I do now when reading the windows cmd guides)
tejasrichard said:
LOL, yeah, I've done that
Click to expand...
Click to collapse
I wiped out 16 years of source code with it once....I got fired.
Kcarpenter said:
I wiped out 16 years of source code with it once....I got fired.
Click to expand...
Click to collapse
Oh damn that's crucial man. Hope they had backups
Screwin around
So I was screwin around with adb tryin to learn this stuff and I stumbled across this by just typing adb after cd'ing in. Hopefully its useful. Mind you I am a total noob to android/linux and this was a total accident. I am sure you all know about it though. Useful info though
Microsoft Windows [Version 6.1.7600]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\>cd\
C:\>cd android-sdk-windows
C:\android-sdk-windows>adb
Android Debug Bridge version 1.0.26
-d - directs command to the only connected USB device.
returns an error if more than one USB device is present.
-e - directs command to the only running emulator.
returns an error if more than one emulator is running.
-s <serial number> - directs command to the USB device or emulator with the given serial number. Overrides ANDROID_SERIAL environment variable.
-p <product name or path> - simple product name like 'sooner', or
a relative/absolute path to a product
out directory like 'out/target/product/sooner'.
If -p is not specified, the ANDROID_PRODUCT_OUT
environment variable is used, which must be an
absolute path.
devices - list all connected devices
connect <host>:<port> - connect to a device via TCP/IP
disconnect <host>:<port> - disconnect from a TCP/IP device
device commands:
adb push <local> <remote> - copy file/dir to device
adb pull <remote> [<local>] - copy file/dir from device
adb sync [ <directory> ] - copy host->device only if changed
(see 'adb help all')
adb shell - run remote shell interactively
adb shell <command> - run remote shell command
adb emu <command> - run emulator console command
adb logcat [ <filter-spec> ] - View device log
adb forward <local> <remote> - forward socket connections
forward specs are one of:
tcp:<port>
localabstract:<unix domain socket name>
localreserved:<unix domain socket name>
localfilesystem:<unix domain socket name>
dev:<character device name>
jdwp:<process pid> (remote only)
adb jdwp - list PIDs of processes hosting a JDWP transport
adb install [-l] [-r] [-s] <file> - push this package file to the device and install it
('-l' means forward-lock the app)
('-r' means reinstall the app, keeping its data)
('-s' means install on SD card instead of internal storage)
adb uninstall [-k] <package> - remove this app package from the device
('-k' means keep the data and cache directories)
adb bugreport - return all information from the device
that should be included in a bug report.
adb help - show this help message
adb version - show version num
DATAOPTS:
(no option) - don't touch the data partition
-w - wipe the data partition
-d - flash the data partition
scripting:
adb wait-for-device - block until device is online
adb start-server - ensure that there is a server running
adb kill-server - kill the server if it is running
adb get-state - prints: offline | bootloader | device
adb get-serialno - prints: <serial-number>
adb status-window - continuously print device status for a specified device
adb remount - remounts the /system partition on the device read-write
adb reboot [bootloader|recovery] - reboots the device, optionally into the bootloade or recovery program
adb reboot-bootloader - reboots the device into the bootloader
adb root - restarts the adbd daemon with root permissions
adb usb - restarts the adbd daemon listening on USB
adb tcpip <port> - restarts the adbd daemon listening on TCP on the specified port
networking:
adb ppp <tty> [parameters] - Run PPP over USB.
Note: you should not automatically start a PPP connection.
<tty> refers to the tty for PPP stream. Eg. dev:/dev/omap_csmi_tty1
[parameters] - Eg. defaultroute debug dump local notty usepeerdns
adb sync notes: adb sync [ <directory> ]
<localdir> can be interpreted in several ways:
- If <directory> is not specified, both /system and /data partitions will be u
pdated.
- If it is "system" or "data", only the corresponding partition
is updated.
C:\android-sdk-windows>
Hi, I'm abcdfv, and I approve this thread.
abcdfv said:
Hi, I'm abcdfv, and I approve this thread.
Click to expand...
Click to collapse
LOL Thanks
I've always been an advocator of EVERYONE learning the ADB basics at least.
updated with run the run the ruu via adb commands
I'm trying to flash my recovery image. I need help. What is the first comand I type at C:\Windows\System32> normally I type cd:\android-sdk-windows\tools
then i adb remount, then adb shell. When I do that now I get "remount failed: Invalid argument" I'm not TOTALLY clueless, although it may turn out that I am after this. any help would be great. I am booted in recovery, but since my recovery image is gone, its just an exclamation in a triangle. if i adb devices, i can see my phone and it says i'm in recovery. Thanks.
I need some serious help with this.....do you need to download anything on your computer?? can you explain all the stuff you need to do leading up to what you type into command prompt...anyone..i need help..i flashed darchstar froyo build and the recovery is all messed up..i cant flash anything..so i need to push a new recovery img.but i don't know anything about adb shell or anything .....please........ive never had to push anything..everyone always just puts flashable zips out for you...HELP

search for all files with the string "abcd" in their names (over adb)

Hello Forum
I would like to search for all files with the string "friendly" in their names over ADB on an USB attached mobile phone (LineageOS 14.1).
(to make sure that i can connect to the mobile phone over adb
[email protected] ~/Desktop/adb $ sudo adb devices
List of devices attached
AB13560G3Z device
I tried many commands like 'adb shell ls -1R | grep friendly', 'adb shell find / name friendly', but no luck
What am I doing wrong?
Any feedback is appreciated very much!
Joe
PS 1:
If possible, without installing additional search-apps on the mobile-phone
PS 2:
The phone is rooted
PS 3:
(as an example, that there is a file with the textstring "friendly" on my mobile phone
[email protected] ~/Desktop/adb $ adb shell pm list packages -f -3
package:/data/app/de.robv.android.xposed.installer-1/base.apk=de.robv.android.xposed.installer
package:/data/app/org.secuso.privacyfriendlynetmonitor-1/base.apk=org.secuso.privacyfriendlynetmonitor

launcher ?

Tryex to Change the launcher out for lawn chair...however b i still get that stupid Walmart button ! Must i really root and deblout ? Tryed to disable the stock launcher but no go !
first you need the fastboot driver software: MTK Fastboot Drivers: https://online.mediatek.com/Public Documents/MTK_Android_USB_Driver.zip
more info on how to install driver software here: https://forum.xda-developers.com/wa.../how-rooted-walmart-onn-tablets-twrp-t4011659
then get adb: ADB and Fastboot: https://www.xda-developers.com/what-is-adb/
copied from: https://forum.xda-developers.com/android/development/amazing-temp-root-mediatek-armv8-t3922213
Download the current mtk-su zip file to your PC and unzip it. Inside will be 2 directories: 'arm' & 'arm64' with an 'mtk-su' binary in each. Pick one for your device. Differences between the flavors:
arm64: 64-bit kernel and userspace
arm: 32-bit userspace on a 64-bit or 32-bit kernel (will also work in 64-bit userspace)
Connect your device to ADB and push mtk-su to your /data/local/tmp folder
i just used the arm not arm64 that seemed to do the trick.
Code:
adb push path/to/mtk-su /data/local/tmp/
Open an adb shell
Code:
adb shell
Change to your tmp directory
Code:
cd /data/local/tmp
Add executable permissions to the binary
Code:
chmod 755 mtk-su
At this point keep your device screen on and don't let it go to sleep. Run the command
Code:
./mtk-su
keep this terminal/command prompt session open then go to...
download this batch file this user made in this post: https://forum.xda-developers.com/wa...s-general/root-walmart-bloat-remover-t4011639
open it inside making sure it is in your adb folder.
it will remove the sams club, walmart app etc.
mine did not remove the walmart button BUT a user posted on how to do so in the comments this is how you do so.
cd into your directory for adb to do so just open cmd/terminal window type this without quotes "cd filepath" replace filepath with where your adb folder is i usually just drag my folder into my terminal/cmd window and it should just put the proper directory into the window.
now type
adb shell
settings put secure sysui_nav_bar "space,back;home;recent,space"
if that does not work also try going into that window you have open with mtk-su and run
settings put secure sysui_nav_bar "space,back;home;recent,space"
sorry if this post is not descriptive enough first post so go easy on me dont hate me too much just trying to help if you have any questions about this that are confusing please ask ill try to fix them trying to help another user of this tablet as i think that the bloatware on these android tablets is ridiculous and makes the experience terrible so id like to help in anyway possible. Thank you.
Slys13 said:
Tryex to Change the launcher out for lawn chair...however b i still get that stupid Walmart button ! Must i really root and deblout ? Tryed to disable the stock launcher but no go !
Click to expand...
Click to collapse
You can use Custom Navigation Bar without root to remove the Walmart button, but I recommend root so you could use QuickSwitch, and some root tweaks with Lawnchair.
Pix12 said:
You can use Custom Navigation Bar without root to remove the Walmart button, but I recommend root so you could use QuickSwitch, and some root tweaks with Lawnchair.
Click to expand...
Click to collapse
I installed that custom navigation app .apk from a third party website because playstore said app was not compatible with device still right away it asks for root, xposed, or to conect to computer to grant permission when I did use the comand prompt and input the command it said device was not compatible. Cool idea though
Sent from my 100015685-E using Tapatalk

Widget binding failure (ATV Launcher)

I've followed the instructions here to install ATV Launcher (free version) on my Shield Pro:
Use Custom Launcher on Nvidia Shield 8.1.1 with Widgets! | TechDoctorUK
www.techdoctoruk.com
I'm now trying to add a widget to the launcher, but am getting a "Widget binding failure" error. I have run the following adb command as recommended, but I still get this error:
appwidget grantbind --package ca.dstudio.atvlauncher.free --user 0
Has anyone managed to add a widget to ATV Launcher recently?
Also, is there any way of setting ATV Launcher as the default launcher on boot? (I've had to use buttonmapper to map the home button to ATV as the Shield always boots back to the stock launcher, despite me having defined ATV Launcher in LaunchX.
I just used this command on my MeCool box. It works fine. You first have to turn on debugging and then use a terminal adb command line to run the command. Make sure you're typing the name of the package correctly.
itm60 said:
Has anyone managed to add a widget to ATV Launcher recently?
Click to expand...
Click to collapse
Yes.
Correct command is:
appwidget grantbind --package ca.dstudio.atvlauncher.free
(without "--user 0")
YSLFOREVA said:
Yes.
Correct command is:
appwidget grantbind --package ca.dstudio.atvlauncher.free
(without "--user 0")
Click to expand...
Click to collapse
Thank you for correcting the command. Is there an easy way to find the installed package name? Just would like to confirm the syntax before I reinstall ATV, and a widget and give this a second try
RG GEIGER said:
Is there an easy way to find the installed package name?
Click to expand...
Click to collapse
You could use ES File Explorer to view package name.
Anyone would know why I'm getting the following error? I can use ADB to remote connect to my TV no problem but running appwidget just won't work.
'appwidget' is not recognized as an internal or external command,
operable program or batch file.
learned something new today. thanks.

Workaround to remap home key

Hello! So I gave up a lot of time ago on having a custom launcher that was opened automatically instead of the stock launcher, but a while ago I thought about a way of using adb logcat to catch the events that launch the stock launcher and replace it with Wolf Launcher (or any other app, actually).
Disclaimer: this method requires a home server where you can run a docker instance or a bash script. It does not work directly inside FireTV.
I have not noticed any performance degradation in the firetv itself, and the latency is almost unnoticeable, to the point I can't even see a frame of the stock launcher (check video below).
I have put together a little script that will run a docker ubuntu instance, in which I then run this command:
./adb logcat '*:I' | grep --line-buffered "ActivityManager: START u0 {act=android.intent.action.MAIN cat=\[android.intent.category.HOME\] flg=0x10[0-9]00000 cmp=com.amazon.tv.launcher/.ui.HomeActivity_vNext" | xargs -I {} ./adb shell am start -n com.wolf.firelauncher/.screens.launcher.LauncherActivity
It will look for lines in the logcat that start the activity "com.amazon.tv.launcher/.ui.HomeActivity_vNext", which happens whenever you tap the home button or choose a firetv profile.
Then it sends a command to open the Wolf Launcher (am start -n com.wolf.firelauncher/.screens.launcher.LauncherActivity).
It can be modified to either listen to other action, or to launch any other app instead of the Wolf Launcher. Hope it's useful
The wallpaper goes to Amazon, for blocking every nice thing we find with updates
Hello @daavm , can you explain how to run that script? I mean, do i need to boot from Ubuntu and open a command window or can I run it on Windows 10?
I have a Fire Tv 4k Stick with wolf launcher, but there is no way i can delete the stock launcher and my son is always pressing the home button to find some videogames i dont want him to. The problem is that Amazon doesnt allow me to hide the recommendations so my only hope is to set the home button to launch the wolf launcher so the kid wont be able to find the %%%%% videogames.
Thank you
but there is no way i can delete the stock launcher a
Click to expand...
Click to collapse
I opened the remote and affixed cello tape on the place where home button is pressed.
Viola -- I also used KODI as default launch after boot using this https[://]f-droid[.]org/packages/news.androidtv.launchonboot/
Queaven said:
Hello @daavm , can you explain how to run that script? I mean, do i need to boot from Ubuntu and open a command window or can I run it on Windows 10?
I have a Fire Tv 4k Stick with wolf launcher, but there is no way i can delete the stock launcher and my son is always pressing the home button to find some videogames i dont want him to. The problem is that Amazon doesnt allow me to hide the recommendations so my only hope is to set the home button to launch the wolf launcher so the kid wont be able to find the %%%%% videogames.
Thank you
Click to expand...
Click to collapse
I guess you could adapt it for Windows, but this makes use of grep, which is a linux module, so you would need to rewrite the script... You can try Ubuntu WSL (https://ubuntu.com/wsl) and run it there I guess
alpenmmilch said:
I opened the remote and affixed cello tape on the place where home button is pressed.
Viola -- I also used KODI as default launch after boot using this https[://]f-droid[.]org/packages/news.androidtv.launchonboot/
Click to expand...
Click to collapse
Hey any idea if firestick supports external control protocols? I stumbled on a Siri shortcut that allows me to control my tcl tv with siri and I’m wondering if I can do the same with the firestick, there has to be a way tho because how else would the firestick app work?
Thanks for sharing!
From your video it looks very good.
I did something with Tasker, when I click on home it shows the Amazon launcher and jumps into Wolf Launcher, but you can clearly see the delay. Takes 1-2 seconds till Wolf Launcher is on.
Why do I need a Linux server with a Docker container?
The command is an ADB command?
Can I just run Remote ADB Shell on my smartphone and connect to my FireTV and copy & paste your code?
Falcon_X said:
Thanks for sharing!
From your video it looks very good.
I did something with Tasker, when I click on home it shows the Amazon launcher and jumps into Wolf Launcher, but you can clearly see the delay. Takes 1-2 seconds till Wolf Launcher is on.
Why do I need a Linux server with a Docker container?
The command is an ADB command?
Can I just run Remote ADB Shell on my smartphone and connect to my FireTV and copy & paste your code?
Click to expand...
Click to collapse
The docker container is just what I decided to use because I use Unraid on my home server. You can just do it on a linux machine without docker. It's just adb, yes.
Not sure how Tasker does it so can't help you with the delay. Haven't used Remote ADB Shell either, so I don't know. Sounds like it would work, but not sure how you would keep it in the background.
daavm said:
The docker container is just what I decided to use because I use Unraid on my home server. You can just do it on a linux machine without docker. It's just adb, yes.
Not sure how Tasker does it so can't help you with the delay. Haven't used Remote ADB Shell either, so I don't know. Sounds like it would work, but not sure how you would keep it in the background.
Click to expand...
Click to collapse
doesn't work. Sadly.
With your command, I got the error, that ./adb doesn't exist. Is adb a file or a folder?
I've tried to create this folder, but as I don't have root access I can't create a folder inside root.
I changed the paths in your command to /storage/emulated/0/adb but I get the error:
/storage/emulated/0/adb: can't execute: Is a directory
/storage/emulated/0/adb: Permission denied
Tried the same with creating a file called adb inside the adb folder - but the same Permission denied
Falcon_X said:
doesn't work. Sadly.
With your command, I got the error, that ./adb doesn't exist. Is adb a file or a folder?
I've tried to create this folder, but as I don't have root access I can't create a folder inside root.
I changed the paths in your command to /storage/emulated/0/adb but I get the error:
/storage/emulated/0/adb: can't execute: Is a directory
/storage/emulated/0/adb: Permission denied
Tried the same with creating a file called adb inside the adb folder - but the same Permission denied
Click to expand...
Click to collapse
? you are trying to run this in the fire tv directly, you have to run it from a linux machine. Download the platform-tools.zip for Android, unzip it, and you will have the adb file there. Again, run this in a linux machine, not inside the fire tv.
I have created a Docker container using the following command on my Synology nas:
sudo docker run -i -t --network=host ubuntu:latest /bin/bash -c "apt-get update && apt-get install -y android-tools-adb && /bin/bash"
With adb connect x.x.x.x:5555 I create a connection to the device and with adb shell I open a command line.
I have removed the ./ before the adb in the script.
But I don't know if it will work like this, I will get my Fire Cube tomorrow.
@daavm
I believe you have connected the device to the docker container via usb and are not running the script remotely.
I would have to find a way to build a Docker container that would automate this and run it remotely if it worked that way.
poyo1975 said:
I have created a Docker container using the following command on my Synology nas:
sudo docker run -i -t --network=host ubuntu:latest /bin/bash -c "apt-get update && apt-get install -y android-tools-adb && /bin/bash"
With adb connect x.x.x.x:5555 I create a connection to the device and with adb shell I open a command line.
I have removed the ./ before the adb in the script.
But I don't know if it will work like this, I will get my Fire Cube tomorrow.
@daavm
I believe you have connected the device to the docker container via usb and are not running the script remotely.
I would have to find a way to build a Docker container that would automate this and run it remotely if it worked that way.
Click to expand...
Click to collapse
No, I haven't connected the device via usb. I do the 'adb connect x.x.x.x:5555' as well. But that doesn't change anything.
You don't have to open the shell. Just run the script in the container.
I've created a Docker aswell, the same way poyo1975 did. Container is running.
I can connect via ADB to my FireTV in the shell from my server, but you said the script needs to run in the container and we don't have to open the shell.
I use Portainer for my Docker containers, I copied and pasted your command in the "command field" and clicked on "deploy container".
I get the error:
failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: exec: "./adb": stat ./adb: no such file or directory: unknown
Still to dumb to understand the whole thing, for me it's more like a trial and error. Hope to get another hint from you daavm
Hi Falcon_X,
I also use portainer, you can build yourself an image.
I have attached my dockerfile and 2 script files.
Just click in Portainer under image build new image and then in the web editor paste the content of the dockerfile.Under upload paste the two script files and click on build.You have to give the image a name for example ubuntu-adb.The adb-connect script file you have to edit with an editor and change the ip address of your firetv.After the image is built you can under the tab container create a new container with the name you gave when creating the image.
At every container restart a connection to the firetv is established and the script of daavm is started.
Should work, but I can only test it tomorrow.
Many thanks to daavm for his script
Falcon_X said:
I've created a Docker aswell, the same way poyo1975 did. Container is running.
I can connect via ADB to my FireTV in the shell from my server, but you said the script needs to run in the container and we don't have to open the shell.
I use Portainer for my Docker containers, I copied and pasted your command in the "command field" and clicked on "deploy container".
I get the error:
failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: exec: "./adb": stat ./adb: no such file or directory: unknown
Still to dumb to understand the whole thing, for me it's more like a trial and error. Hope to get another hint from you daavm
Click to expand...
Click to collapse
Again, ./adb will only work if you have downloaded platform-tools zip and unzipped it (which has adb inside). Alternatively, you can do apt install adb, and replace "./adb" by just "adb"
As an update, I now use the following script as a custom script in a linuxserver/webtop container (check linuxserver docs on how to use custom scripts):
Bash:
#!/bin/bash
echo "**** Installing ADB ****"
apt update && apt install -y adb
adb connect 192.168.0.97:5555
while true; do adb logcat | grep -G --line-buffered "ActivityManager: START u0 {act=\(com\.amazon\.tv\.action\.LAUNCH_PROFILE_PICKER\|android\.intent\.action\.MAIN cat=\[android\.intent\.category\.HOME\]\) flg=0x10\(0\|1\|2\)00000 cmp=com\.amazon\.\(tv\.launcher/\.ui\.HomeActivity_vNext\|ftv\.profilepicker/\.ui\.PickerActivity\)" | xargs -I {} adb shell am start -n com.wolf.firelauncher/.screens.launcher.LauncherActivity; done
I included the profile picker listener because I didn't want to have to select the profile every single time.
Awesome. Works flawlessly. Thank you!
Running on a old debian based raspberry pi zero.
Thanks again to daavm and poyo1875. Works!
Update: Only works until you shutdown the FireTV :-(
thanks
daavm said:
As an update, I now use the following script as a custom script in a linuxserver/webtop container (check linuxserver docs on how to use custom scripts):
Bash:
#!/bin/bash
echo "**** Installing ADB ****"
apt update && apt install -y adb
adb connect 192.168.0.97:5555
while true; do adb logcat | grep -G --line-buffered "ActivityManager: START u0 {act=\(com\.amazon\.tv\.action\.LAUNCH_PROFILE_PICKER\|android\.intent\.action\.MAIN cat=\[android\.intent\.category\.HOME\]\) flg=0x10\(0\|1\|2\)00000 cmp=com\.amazon\.\(tv\.launcher/\.ui\.HomeActivity_vNext\|ftv\.profilepicker/\.ui\.PickerActivity\)" | xargs -I {} adb shell am start -n com.wolf.firelauncher/.screens.launcher.LauncherActivity; done
I included the profile picker listener because I didn't want to have to select the profile every single time.
Click to expand...
Click to collapse
thanks! it's looks worked!
i have 2 questions
1. The adb log looks like this, is it normal?
2. Oops, when i press home, I can still see the Amazon home page, it will start after about 1 second.
Code:
Starting: Intent { cmp=com.wolf.firelauncher/.screens.launcher.LauncherActivity }
Warning: Activity not started, its current task has been brought to the front
Starting: Intent { cmp=com.wolf.firelauncher/.screens.launcher.LauncherActivity }
Warning: Activity not started, its current task has been brought to the front
Starting: Intent { cmp=com.wolf.firelauncher/.screens.launcher.LauncherActivity }
Warning: Activity not started, its current task has been brought to the front
...
SevenFXD said:
thanks
thanks! it's looks worked!
i have 2 questions
1. The adb log looks like this, is it normal?
2. Oops, when i press home, I can still see the Amazon home page, it will start after about 1 second.
Code:
Starting: Intent { cmp=com.wolf.firelauncher/.screens.launcher.LauncherActivity }
Warning: Activity not started, its current task has been brought to the front
Starting: Intent { cmp=com.wolf.firelauncher/.screens.launcher.LauncherActivity }
Warning: Activity not started, its current task has been brought to the front
Starting: Intent { cmp=com.wolf.firelauncher/.screens.launcher.LauncherActivity }
Warning: Activity not started, its current task has been brought to the front
...
Click to expand...
Click to collapse
The Adb log looks the same for me, too.
When I press home, I don't see the Amazon Launcher.
But when I shutdown the FireTV and my container is still running, it just shows: -- waiting for device --
When I turn the FireTV back on, it's still not recognized (IP is still the same).
Looks like I have to connect via ABD and re-run the script every time again, when I turn on the FireTV after a shutdown.
Can someone confirm this or is it just me?

Categories

Resources