Q: How to get the list of installed apps on a webos TV? how can I get a list on the installed apps on a WebOS smarttv? One that has the app ids, an I'm trying to open them later with the application manager.
I'm on a 2019 model with WebOS 4.7.2 and I have devmode enabled, can run apps from the ide etc.
I've tried using the application manager:
webOS.service.request("luna://com.webos.service.applicationmanager", {
    method: "listApps",
    parameters: {},
    onSuccess: function (res) {
        console.log("List apps success. ", res);
    },
    onFailure: function (res) {
        console.log("List apps fail. ", res);
    },
});

It fails with { errorCode: -1, errorText: "Denied method call "listApps" for category "/"", returnValue: false }
If I try with dev/listApps, I instead get { errorCode: -1, errorText: "Unknown method "listApps" for category "/dev"", returnValue: false }, but note that this:
webOS.service.request("luna://com.webos.service.devmode", {
            method: "setDevMode",
            parameters: {
                enabled: true
            },
            onSuccess: function (res) {
                console.log("Devmode success. ", res);
                webOS.service.request("luna://com.webos.service.devmode", {
                    method: "getDevMode",
                    parameters: {},
                    onSuccess: function (res) {
                        console.log("get devmode success. ", res);
                    },
                    onFailure: function (res) {
                        console.log("get devmode fail. ", res);
                    },
                });
            },
            onFailure: function (res) {
                console.log("Devmode fail. ", res);
            },

Gives me Service does not exist: com.webos.service.devmode
For good measure, I also tried with the CLI, using examples from the webos site.
ares-install --device webOS_TV --listfull results in listing this single app:
id:com.domain.app, defaultWindowType:card, CPApp:false, systemApp:false, version:0.0.1, vendor:My Company, hasPromotion:false, tileSize:normal, icons:, largeIcon:largeIcon.png, lockable:true, transparent:false, icon:icon.png, checkUpdateOnLaunch:true, spinnerOnLaunch:true, handlesRelaunch:false, unmovable:false, inspectable:true, inAppSetting:false, privilegedJail:false, noSplashOnLaunch:false, title:CommandsTest, deeplinkingParams:, trustLevel:default, visible:true, folderPath:/media/developer/apps/usr/palm/applications/com.domain.app, accessibility:[object Object], main:index.html, removable:true, type:web, disableBackHistoryAPI:false, installTime:0

For reference, I know this is possible because in this question: Get icon of installed apps on WebOS TV LG someone mentions getting a list of apps just to get their icons, and it has the youtube app as an example of one of the items.
I saw this question but the library used in the answer is pretty old, and I haven't been able to run it (also I kinda need the list at runtime). Some of those app ids worked on my testing tho, for opening them with application manager.
Thank you!

A: Please, check official WebOS developer documentation for TVs - http://webostv.developer.lge.com/api/webos-service-api/application-manager/
I can't see methods like 'listApps' or 'setDevMode' there. Also, there is a big red label at your provided application manager link about compatibility


A: Please add more ACG application.operation to requiredPermissions in your appinfo.json, somethings like:
{
  "id": "com.webapp.webosose",
  "version": "1.0.0",
  "vendor": "My Company",
  "type": "web",
  "main": "index.html",
  "title": "WebOS OSE APP",
  "icon": "icon.png",
  "requiredPermissions": [
    "application.operation"
  ]
}

// Post for anyone can be needed :)
