How to grant permissions to ADB? I can use ADB while in recovery mode (TWRP) so to use it normally, I followed Android - Enable ADB from recovery to enable USB debugging. There is always an error while switching users, granting permissions, unhiding apps, using am and pm commands. 

This is the error that always comes:


  Error: java.lang.SecurityException: Neither user 2000 nor current process has android.permission.INSTALL_PACKAGES.


How to grant permissions to ADB?
Call "adb root" before calling "pm install -r xxx.apk"