-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpms_log_ctrl
More file actions
executable file
·22 lines (19 loc) · 849 Bytes
/
pms_log_ctrl
File metadata and controls
executable file
·22 lines (19 loc) · 849 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/sh
# https://support.apple.com/en-us/HT201063
SW=$1
if [ ${SW:-X} = ON ]; then
sudo defaults write /Library/Preferences/com.apple.apsd APSWriteLogs -bool TRUE
sudo defaults write /Library/Preferences/com.apple.apsd APSLogLevel -int 7
sudo killall apsd
sudo defaults write /Library/Preferences/com.apple.ProfileManager debugOutput 3
sudo killall -u _devicemgr
echo "see /Library/Logs/apsd.log and devicemgr logs"
elif [ ${SW:-X} = OFF ]; then
sudo defaults write /Library/Preferences/com.apple.apsd APSWriteLogs -bool FALSE
sudo defaults delete /Library/Preferences/com.apple.apsd APSLogLevel
sudo killall apsd
sudo defaults delete /Library/Preferences/com.apple.ProfileManager debugOutput
sudo killall -u _devicemgr
else
echo "$0 ON|OFF"
fi