Search code examples
androidcommand-linepermissionsadb

Is there an ADB command to change the advanced settings of an installed application?


I have been trying to figure out a command using ADB command line to change the advanced settings of an application I am installing through ADB.

Once installed I wish to change the following settings to 'allow' by using an ADB command:

enter image description here

Is this possible?

I thought it might be: found here
adb shell pm grant com.mycompany.mypackage INSTALL_NON_MARKET_APPS 1


Solution

  • The command for the Install unknown apps would be:

    adb shell pm grant com.company.testapp  android.permission.REQUEST_INSTALL_PACKAGES
    

    Which will fail, because android.permission.REQUEST_INSTALL_PACKAGES is not a changeable permission type:

    Operation not allowed: java.lang.SecurityException: Permission android.permission.REQUEST_INSTALL_PACKAGES is not a changeable permission type
    

    Maybe there is a way around this, that I don't know of.