I have an macOS SwiftUI app that i want to check the Find My status of the device. Currently I'm using system_profiler to get the result
task.launchPath = "/bin/bash"
task.arguments = ["-c", "system_profiler SPHardwareDataType | grep 'Activation Lock Status:' | xargs | cut -f 4- -d ' '"]
This returns just "Enabled" or "Disabled"
However that doesn't work if you have Sandbox enabled. Then it just returns an empty string.
Does anyone have a workaround for this or maybe point me in the right direction for this case?