macOS에서 Karabiner 삭제시 응용 프로그램 내 아이콘 잠긴상태로 삭제안될때
macOS에서 Karabiner를 삭제할때, Karabiner앱상의 'Uninstall Karabiner'를 사용해도 간혹 '응용 프로그램'내 0Byte짜리 아이콘이 남는 경우가 생깁니다.
이 문제를 해결하기위해 국내 커뮤니티를 한참 뒤져봤으나 답이 없었는데, 등잔밑이 어둡다고 Karabiner 사이트에 이런 문제에 대해 맨 아래 해결책이 나와있더군요.
아래와 같은 내용입니다.
터미널에서
sudo chflags nouchg,noschg /Applications/Karabiner-Elements.app
를 입력 후, 엔터
sudo chflags nouchg,noschg /Applications/Karabiner-EventViewer.app
를 입력 후, 엔터
이렇게 2번 진행하면 되는데, 이때 해당 명령이 작동안될때가 있습니다. 이때는 터미널에 권한이 부여되지 않아서입니다.
이때는 당황하지 마시고 우측 상단에 보시면 '터미널'에 권한을 부여하겠냐는 작은 팝업이 보이고 '허용'이 보입니다.
이때 '허용'을 클릭하면, 설정창 팝업이 뜨며 '터미널'에 권한부여 스위치가 있는 메뉴로 자동으로 이동합니다.
이걸 켜시고, 위 명령어를 다시한번 차례대로 입력하시면 잠김이 풀립니다.
이후, 응용 프로그램 폴더에서 해당 Karabiner Elements와 karabiner event viewer를 삭제하시면 되십니다.
Why these files are protected
This protection is intended to prevent incomplete uninstallation.
Karabiner-Elements is a system-wide software, and files are installed in appropriate locations besides the Applications folder.
Therefore, if you just put the application icon in Trash like a normal app uninstallation, some files will be left behind.
The file protection forces to use the built-in uninstaller and remove installed files properly at the uninstallation.
Advanced topic
This file locking is achieved with schg and uchg flags.
You can unlock these files by the following commands in Terminal.
sudo chflags nouchg,noschg /Applications/Karabiner-Elements.app
sudo chflags nouchg,noschg /Applications/Karabiner-EventViewer.app
(Administrator password is required to run the above command.)