# SELinux denials in Android can be debugged with 'adb shell dmesg | grep avc'

**Date:** 2025-12-01  
**Tags:** Android, Security, SELinux  
**URL:** https://kelexine.is-a.dev/til/android-selinux-permissive

---

TIL: SELinux denials in Android can be debugged with 'adb shell dmesg | grep avc'. When porting ROMs, set permissive mode temporarily: 'setenforce 0'. Don't ship it permissive though—fix the policies!


```bash
# Check SELinux status
adb shell getenforce

# View denials
adb shell dmesg | grep avc: | tail -20

# Temporarily set permissive (TESTING ONLY)
adb shell setenforce 0
```




---

*This content is available at [kelexine.is-a.dev/til/android-selinux-permissive](https://kelexine.is-a.dev/til/android-selinux-permissive)*
