news 2026/6/10 13:07:01

【教程】MacOS绕过Apple Develop ID获取麦克风权限

作者头像

张小明

前端开发工程师

1.2k 24
文章封面图
【教程】MacOS绕过Apple Develop ID获取麦克风权限

转载请注明出处:小锋学长生活大爆炸[xfxuezhagn.cn]

如果本文帮助到了你,欢迎[点赞、收藏、关注]哦~

以这个电脑音频频谱显示工具为例:https://github.com/1061700625/SpectraTray

使用Swift

不需要Apple Develop ID,推荐!

原理是通过swift来做一个启动器。

0、准备干净的环境。

python -m venv tray source tray/bin/activate pip install -i https://pypi.org/simple pystray pillow numpy SoundCard pyobjc

1、创建原生启动器 App。

mkdir -p SpectraTray.app/Contents/{MacOS,Resources} mkdir -p SpectraTray.app/Contents/Resources/pysrc cp app.py SpectraTray.app/Contents/Resources/pysrc/ cp -R tray SpectraTray.app/Contents/Resources/tray cp SpectraTray.ico SpectraTray.app/Contents/Resources/

2、写 Swift 启动器。

cat > main.swift <<'SWIFT' import Foundation import AVFoundation func runPython() { let bundleURL = Bundle.main.bundleURL let py = bundleURL.appendingPathComponent("Contents/Resources/tray/bin/python3").path let script = bundleURL.appendingPathComponent("Contents/Resources/pysrc/app.py").path let task = Process() task.executableURL = URL(fileURLWithPath: py) task.arguments = [script] // 完全后台(不弹终端) task.standardOutput = FileHandle.nullDevice task.standardError = FileHandle.nullDevice do { try task.run() } catch { } exit(0) } // 先触发一次麦克风权限(允许后 python 才能录到 BlackHole) AVCaptureDevice.requestAccess(for: .audio) { _ in runPython() } RunLoop.main.run() SWIFT swiftc main.swift -o SpectraTray.app/Contents/MacOS/SpectraTray

3、写 Info.plist。

cat > SpectraTray.app/Contents/Info.plist <<'PLIST' <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>CFBundleName</key><string>SpectraTray</string> <key>CFBundleDisplayName</key><string>SpectraTray</string> <key>CFBundleIdentifier</key><string>local.spectratray</string> <key>CFBundleExecutable</key><string>SpectraTray</string> <key>CFBundlePackageType</key><string>APPL</string> <key>CFBundleShortVersionString</key><string>0.0.2</string> <key>CFBundleVersion</key><string>1</string> <key>CFBundleIconFile</key><string>SpectraTray.ico</string> <key>LSBackgroundOnly</key><true/> <key>NSMicrophoneUsageDescription</key><string>用于捕获系统音频(如 BlackHole)并显示实时频谱</string> <key>LSApplicationCategoryType</key><string>public.app-category.utilities</string> </dict> </plist> PLIST

4、去掉 quarantine。

xattr -dr com.apple.quarantine SpectraTray.app

5、刷新图标。

touch SpectraTray.app

6、启动 SpectraTray.app

版权声明: 本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若内容造成侵权/违法违规/事实不符,请联系邮箱:809451989@qq.com进行投诉反馈,一经查实,立即删除!
网站建设 2026/6/10 10:20:34

Open Notebook:构建你的个人AI知识大脑的终极指南

Open Notebook&#xff1a;构建你的个人AI知识大脑的终极指南 【免费下载链接】open-notebook An Open Source implementation of Notebook LM with more flexibility and features 项目地址: https://gitcode.com/GitHub_Trending/op/open-notebook 还在为信息过载而苦…

作者头像 李华
网站建设 2026/6/10 12:52:26

通过SSH访问远程Miniconda容器跑通PyTorch训练任务

通过SSH访问远程Miniconda容器跑通PyTorch训练任务 在深度学习项目开发中&#xff0c;一个常见的困境是&#xff1a;本地笔记本只能跑几个epoch的小模型&#xff0c;而真正的训练必须依赖远程GPU服务器。但每次换机器就得重新配置环境、安装依赖、调试版本冲突——“在我电脑上…

作者头像 李华
网站建设 2026/6/10 13:04:11

高频电路中电感封装选择:深度剖析关键参数

高频电路中电感封装怎么选&#xff1f;一文讲透那些被忽略的关键细节你有没有遇到过这样的情况&#xff1a;一个精心设计的DC-DC电源&#xff0c;效率始终上不去&#xff1b;EMC测试时在30–100 MHz频频“爆表”&#xff0c;反复改板无果&#xff1b;射频前端匹配网络调不准&am…

作者头像 李华
网站建设 2026/6/10 11:35:26

告别重复代码噩梦:Pylint相似性检测工具实战指南

告别重复代码噩梦&#xff1a;Pylint相似性检测工具实战指南 【免费下载链接】pylint Its not just a linter that annoys you! 项目地址: https://gitcode.com/gh_mirrors/pyl/pylint 你是否曾经在维护代码时发现不同文件中出现了几乎相同的代码块&#xff1f;&#x1…

作者头像 李华
网站建设 2026/6/10 0:07:48

DeepSkyStacker终极指南:从模糊星点到清晰星系的蜕变之旅

DeepSkyStacker终极指南&#xff1a;从模糊星点到清晰星系的蜕变之旅 【免费下载链接】DSS DeepSkyStacker 项目地址: https://gitcode.com/gh_mirrors/ds/DSS 你是否曾经在星空下拍摄了数十张照片&#xff0c;却发现每张都充满了噪点和模糊&#xff0c;完全无法展现夜空…

作者头像 李华
网站建设 2026/6/10 10:51:52

RPCS3模拟器终极教程:从零开始快速配置完整指南

RPCS3模拟器终极教程&#xff1a;从零开始快速配置完整指南 【免费下载链接】rpcs3 PS3 emulator/debugger 项目地址: https://gitcode.com/GitHub_Trending/rp/rpcs3 还在为无法在电脑上畅玩PS3经典游戏而烦恼吗&#xff1f;RPCS3模拟器作为目前最优秀的PS3模拟解决方案…

作者头像 李华