adb授予安卓手機應用權限


參考連接:

https://greenify.uservoice.com/knowledgebase/articles/749142-how-to-grant-permissions-required-by-some-features

https://stackoverflow.com/questions/52079343/how-can-i-use-adb-to-grant-permission-without-root

 

eg:

授予權限命令:

 adb -d shell pm grant package android.permission.CAMERA

移除權限命令:

adb -d shell pm revoke package android.permission.CAMERA

有可能發生的問題:

無法獲取權限,並報錯:Security exception: grantRuntimePermission: Neither user 2000 nor current process has android.permission.GRANT_RUNTIME_PERMISSIONS.

問題原因:

有些具有侵略性的權限無法直接被申請,但是一般手機有個設置可以規避這個問題,以realMe為例

解決方法:

realme:打開禁止權限監控

 

華為手機暫時未發現此項設置,但是可以直接使用

 

腦殘小米不插sim卡無法打開USB調試,醉了

 

 

 

 

 

 

 

 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM