Frage

I need to set the default application to be launched when clicking the home button. Currently I am doing that by selecting the application in the Trebuchet launcher and clicking "Always". But in my case I need to do that using the shell, since I only have remote access the device using SSH. Does anyone knows in which file or database the information is stored?

War es hilfreich?

Lösung

Preferred apps are stored in

/data/system/users/0/package-restrictions.xml

Update this file to set default applications as you need. Remember to reboot afterwards to apply the new settings.

It's also worth mentioning that the file seems to be always opened and modified by android on boot, so better check after change and reboot that your settings are still there as it might not always be the case (If there is an error for example).

Also if you set an app as default for some intent and this app crashes, you have to change that XML file again to restore your settings as android would automatically unset an app as default if it crashed.

Source

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top