How can I change the launcher in android source code for TV?

good morning guys how can i change the launcher of the android tv in the code source not installing the apk

android.mk add demo:

LOCAL_OVERRIDES_PACKAGES := Home Launcher2 Launcher3
2 Likes

Good morning @goenjoy well i have my own app I have copied the source code in vendor/vim3
and i have call it in .mk file but still the same problem i cant boot

@Boudour Are you sure you have compiled and packaged into firmware?

1 Like

@goenjoy yup i am sure

Post screenshots of your out//system/app and out//system/priv-app folders and inside the folder of your launcher in those folders, which one it is in.

3 Likes

Good morning @mo123 there is no app folder under /system

this is the screen of /system

and my questions is i have my own launcher i wanna add it to my source code iā€™m not gonna use the default launcher of the aosp which is Launcher2 nor 3 so how can do this.
i had a solution but it doesnt work for me .

i created a folder under /packages/app/Launcher
then i putted the .apk there and i have create the Android.mk file

LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := Launcher
LOCAL_MODULE_CLASS := APPS
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_SUFFIX := $(COMMON_ANDROID_PACKAGE_SUFFIX)
LOCAL_CERTIFICATE := platform
LOCAL_SRC_FILES := Launcher.apk
LOCAL_MODULE_OWNER := system
include $(BUILD_PREBUILT)

@Boudour mkdir vendor/amlogic/common/apps/Launcher
cp your/Launcher.apk vendor/amlogic/common/apps/Launcher/
vim Android.mk

#Launcher
LOCAL_PATH := $(call my-dir)
	include $(CLEAR_VARS)
	LOCAL_MODULE := Launcher
	LOCAL_MODULE_CLASS := APPS
	LOCAL_MODULE_TAGS := optional
	LOCAL_BUILT_MODULE_STEM := package.apk
	LOCAL_MODULE_SUFFIX := $(COMMON_ANDROID_PACKAGE_SUFFIX)
	LOCAL_CERTIFICATE := PRESIGNED
	LOCAL_SRC_FILES := $(LOCAL_MODULE).apk
	LOCAL_DEX_PREOPT:=false	
	LOCAL_OVERRIDES_PACKAGES := Home Launcher2 Launcher3
	include $(BUILD_PREBUILT)

/build/target/product/core.mk PRODUCT_PACKAGES +=Launcher

1 Like

A post was split to a new topic: VIM3问题å’ØčÆ¢ļ¼šē”Øę„åšęœŗ锶ē›’

Hi @goenjoy
I followed your step to do, but I still canā€™t work.git clone source code as below

repo init -u https://github.com/khadas/android_manifest.git -b khadas-vims-pie
repo sync -j4

then I do
mkdir vendor/amlogic/common/apps/Launcher
cp my/Launcher.apk vendor/amlogic/common/apps/Launcher/
vim Android.mk

#Launcher
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := Launcher
LOCAL_MODULE_CLASS := APPS
LOCAL_MODULE_TAGS := optional
LOCAL_BUILT_MODULE_STEM := package.apk
LOCAL_MODULE_SUFFIX := $(COMMON_ANDROID_PACKAGE_SUFFIX)
LOCAL_CERTIFICATE := PRESIGNED
LOCAL_SRC_FILES := $(LOCAL_MODULE).apk
LOCAL_DEX_PREOPT:=false	
LOCAL_OVERRIDES_PACKAGES := Home Launcher2 Launcher3
include $(BUILD_PREBUILT)

So my ā€œvendor/amlogic/common/apps/Launcherā€ folder have two file ā€œLauncher.apkā€ and ā€œAndroid.mkā€
Finally DO ā€œ/build/target/product/core.mk PRODUCT_PACKAGES +=Launcherā€
then build source code

source build/envsetup.sh
lunch kvim3-userdebug.
make -j24 otapackage

which steps I wrong ?

find out/target/product/kvim3/ -iname "Launcher.apk"

Execute the above command and post the output results to see.

Hi @goenjoy
I can not find file ā€œLauncher.apkā€
I always find file ā€œLauncher3ā€ folder in /out/target/product/kvim3/system/priv-app/

vim vendor/amlogic/common/apps/Launcher/Android.mk

Execute the above command and post the output results to see.

Maybe youā€™re adding something wrong.
Or you can replace the Launcher3 character with Launcher in device/khadas/

hlm@Server:/users/hlm/khadas$ grep -rn "Launcher3" device/khadas/
device/khadas/common/products/mbox/product_mbox.mk:70:#Launcher3
device/khadas/common/products/mbox/product_mbox.mk:72:    Launcher3

Hi @goenjoy
My Android.mk

#Launcher
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := Launcher
LOCAL_MODULE_CLASS := APPS
LOCAL_MODULE_TAGS := optional
LOCAL_BUILT_MODULE_STEM := package.apk
LOCAL_MODULE_SUFFIX := $(COMMON_ANDROID_PACKAGE_SUFFIX)
LOCAL_CERTIFICATE := PRESIGNED
LOCAL_SRC_FILES := $(LOCAL_MODULE).apk
LOCAL_DEX_PREOPT:=false
LOCAL_OVERRIDES_PACKAGES := Home Launcher2 Launcher3
include $(BUILD_PREBUILT)

And I try to replace the Launcher3 character with Launcher in device/khadas.
system has create folder in ā€œ/out/target/product/kvim3/system/app/Launcher/Launcher.apkā€, but I use update.img to burn img to VIM3 board. It can not work.

The problem has been solved. I donā€™t understand what you mean by not working.

Hi @goenjoy
I think I try to power on system by VIM3 board, I will see the android TV launcher.
But I still see android Pie launcher download from VIM website img ā€œVIM3_Pie_V190809ā€.

You can delete Launcher3 with ADB command first and then restart it to see.

Hi @goenjoy
Itā€™s working
I try to rebuild again

source build/envsetup.sh
lunch kvim3-userdebug
make installclean
make -j24 otapackage

thanks a lot