2017-11-14 22 views
1

v 6.0.1 이상 버전을 사용하는 루트가 아닌 Android 기기의 경우 ADB를 사용하여 NFC를 사용/사용 중지 할 수 있습니까? 나는 많은 것을 시도했지만 그것은 나를 위해 일하지 않을 것이다. 내가 시도Native Android Device> ADB가 장착 된 NFC를 켜기/끄기

물건은 다음과 같습니다

통해 ADB : 또한

adb shell settings put global airplane_mode_toggleable_radios bluetooth,cell,wimax,nfc 
adb shell am broadcast -a android.intent.action.airplane_mode_toggleable_radios 

adb shell settings put global airplane_mode_on 1 
adb shell am broadcast -a android.intent.action.AIRPLANE_MODE 

adb shell settings put global radio_nfc 0 
adb shell am broadcast -a android.intent.action.radio_nfc 

adb shell settings put global AIRPLANE_MODE_RADIOS 0 
adb shell am broadcast -a android.intent.action.AIRPLANE_MODE_RADIOS 

adb shell settings put global NfcAdapter 0 
adb shell am broadcast -a android.intent.action.NFC_adapter 

adb shell settings put global airplane_mode_radios cell,bluetooth,nfc,wimax 
adb shell content update --uri content://settings/global --bind value:s:'bluetooth,nfc,wimax' --where "name='airplane_mode_radios'" 

:

adb shell settings get global airplane_mode_radios 
adb shell content query --uri content://settings/global --projection name:value --where "name='airplane_mode_radios'" 

adb shell settings put global airplane_mode_radios "cell,nfc,wimax" 
adb shell content update --uri content://settings/global --bind value:s:'cell,nfc,wimax' --where "name='airplane_mode_radios'" 

adb shell settings put global airplane_mode_radios "cell,bluetooth,wifi,nfc,wimax" 
adb shell content update --uri content://settings/global --bind value:s:'cell,bluetooth,wifi,nfc,wimax' --where "name='airplane_mode_radios'" 

내가 ADB와 비행기 모드를 ON 할 수있는 장치를 다시 시작하지만 NFC는 않습니다 안된다. 기본 장치 (빠른 설정 또는 설정)에서 비행기 모드를 켤 때 꺼집니다!

내가 시도 또 다른 하나는 다음과

목록 실행중인 서비스 :

:

adb shell service list 

당신이 NFC를 읽을 수는 9 번 "[android.nfc.INfcAdapter] NFC"에서 실행

이 작동하지 않습니다

adb shell pm hide com.android.nfc 

으로 해제하려고 던졌습니다 : 012,351,오류 : java.lang.SecurityException : 사용자 2000이나 현재 프로세스 모두 android.permission.MANAGE_USERS가 없습니다.

나 :

adb shell pm grant EXAMPLE.android.services android.permission.WRITE_SECURE_SETTINGS 
adb shell pm grant EXAMPLE.android.services android.permission.CHANGE_CONFIGURATION 

-

안드로이드 5 배까지 장치에서 작동하고 다음 Enable/Disable NFC with ADB command

+0

이 중복되지 않습니다. –

답변

0

안드로이드 산들 바람 (6.0 Enable/Disable NFC with ADB command

놀아 후. 0 또는 6.0.1)

service call nfc 5

사용

service call nfc 6

편집 :

것은이 실제 발견 서비스

에게 재 - 수 재부팅, 영구적으로 해제하지 않는 것 대답!

svc nfc <enable|disable>

+0

안녕하세요 @Freshollie, 이 작품! 감사합니다. –