Is there any way to disable/enable NFC
via ADB
shell commands?
I found one answer here.
What I tried from the above link:
# Enable NFC
service call nfc 5
# Disable NFC
service call nfc 4
but it's not working.
Any help appreciated. Thanks.
For Android Version > 7, please use following -
Verified on 7.1.1... Should work for atleast 7.x
Please try this
please check here in slide no 32
# Disable NFC
service call nfc 7
Verified for Android 8.0
Cheers!
In your DDMS of eclipse or using logfilter or any runtime log capturing tool, you need to get the process ID of your NFCService. Then you can kill or stop that process by giving the process ID.
System services' method codes may vary with
Android
versions. Therefore, before making a service's method call browse theAOSP
sources.Below is a summary of the
NFC
's enable/disable calls up toAndroid
5.1.1. Also keep in mind that (in the sources),i.e. equals to
1
.Android 4.4 - Android 5.1.1:
Android 4.0.1 - Android 4.3.1:
Android 2.3.4 - Android 2.3.7:
Android 2.3.3:
Android 2.3.2:
To check the status of the
NFC
service use thedumpsys
command:I don't know why no one has posted this already
svc nfc <enable|disable>
Works perfectly
Edit: Requires > Android 6.0