Here I am documenting my systematic approach. It is loosely based on, and initiated by, the answer by @vijay-rajpurohit, which is in turn based on comment by @Robert @1431720 . Note that the final result is particular to my MacOS machine, based on the logs shown below. It will be different in your MacOS.
In first attempt, I first checked the logs using: log show --style syslog | grep ...
but it is taking too long. I accidentally checked /var/log/wifi.log
after exploring the /var/log/
(I am also curious about /var/log/powermanagement/*.asl
).
This turned out to be most useful:
cat /var/log/wifi.log|grep -i "Wake reason"
Then found this line: (note the EC.
bit)
Thu Apr 23 22:41:32.359 Info: <airportd[219]> _systemWokenByWiFi: System wake reason: <EC.ARPT>, was woken by WiFi
Then googled for EC.ARPT
, I found the following commands:
pmset -g log
Useful stats about "Total Sleep/Wakes since boot".
pmset -g assertions
This turned out to show the full answer to this question:
2020-04-24 02:23:38 +0100
Assertion status system-wide:
BackgroundTask 1
ApplePushServiceTask 0
UserIsActive 1
PreventUserIdleDisplaySleep 0
PreventSystemSleep 0
ExternalMedia 0
PreventUserIdleSystemSleep 0
NetworkClientActive 0
Listed by owning process:
pid 111(hidd): [0x0000200a000986a9] 00:00:00 UserIsActive named: "com.apple.iohideventsystem.queue.tickle.4295010950.3"
pid 85(apsd): [0x0003b830000b90bd] 00:00:10 ApplePushServiceTask named: "com.apple.apsd-waitingformessages-push.apple.com"
Kernel Assertions: 0x100=MAGICWAKE
id=504 level=255 0x100=MAGICWAKE mod=24/04/2020, 01:57 description=en0 owner=en0
Idle sleep preventers: IODisplayWrangler
In short, in a systematic approach, I explored the following keywords based on the logs, and googled each :
EC.ARPT
(example link)
iohideventsystem
(example link)
MAGICWAKE
(example link)
ApplePushServiceTask
(see below)
Most informative item emerged from the output of pmset -g assertions
. For example ApplePushServiceTask
in the following line:
pid 85(apsd): [0x0003b830000b90bd] 00:00:10 ApplePushServiceTask named: "com.apple.apsd-waitingformessages-push.apple.com"
The solution that seems to work in my particular case (not a general solution) was to disable :
/System/Library/LaunchDaemons/com.apple.apsd.plist
using launchctl
. But this cannot be done until you do a csrutil disable
in the safe mode. I don't write instructions here because it need caution and you need to enable it later.
(to be updated)
/var/log/syslog
(Linux) or/var/log/system.log
(Mac)? – Scanties