最近在做Autostart,但是沒(méi)有bench R1環(huán)境 目前在模擬器上調(diào)試,需要調(diào)試自定義的廣播和獲取懸浮窗權(quán)限(因?yàn)檫@個(gè)app需要在開(kāi)機(jī)未啟動(dòng)app的情況啟動(dòng)服務(wù)區(qū)獲取傳感器信號(hào)然后全局彈窗)。
需要先adb root adb remount
1.發(fā)送廣播給指定應(yīng)用:文章來(lái)源:http://www.zghlxwxcb.cn/news/detail-641498.html
adb shell am broadcast -a android.intent.action.BOOT_COMPLETED -n com.fca.uconnect.autonomy/.receiver.NotificationStartUpReceiver
2.包名獲取懸浮窗(或者其他權(quán)限)文章來(lái)源地址http://www.zghlxwxcb.cn/news/detail-641498.html
adb shell appops set com.fca.uconnect.autonomy SYSTEM_ALERT_WINDOW allow
到了這里,關(guān)于Adb發(fā)送特定廣播給App和App獲取權(quán)限的命令的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!