最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

swift - How can i check Find My status in macOS app? - Stack Overflow

programmeradmin0浏览0评论

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?

发布评论

评论列表(0)

  1. 暂无评论