news 2026/7/4 0:06:25

【教程】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/7/2 13:28:03

Arroyo自定义函数开发实战:构建高效流处理业务逻辑

Arroyo自定义函数开发实战&#xff1a;构建高效流处理业务逻辑 【免费下载链接】arroyo Distributed stream processing engine in Rust 项目地址: https://gitcode.com/gh_mirrors/ar/arroyo 在实时数据处理领域&#xff0c;自定义函数是连接通用流处理引擎与特定业务需…

作者头像 李华
网站建设 2026/6/30 23:05:56

终极指南:Cap跨平台录屏工具完整性能评测与实战应用

终极指南&#xff1a;Cap跨平台录屏工具完整性能评测与实战应用 【免费下载链接】Cap Effortless, instant screen sharing. Open-source and cross-platform. 项目地址: https://gitcode.com/GitHub_Trending/cap1/Cap Cap作为一款基于Rust和Tauri框架构建的开源跨平台…

作者头像 李华
网站建设 2026/7/1 19:17:49

使用Miniconda初始化脚本自动激活PyTorch环境

使用Miniconda初始化脚本自动激活PyTorch环境 在现代AI开发中&#xff0c;一个常见的痛点是&#xff1a;为什么代码在同事的机器上跑得好好的&#xff0c;到了自己这边却各种报错&#xff1f;更别提项目多了之后&#xff0c;PyTorch 1.x 和 2.x 混用、CUDA版本不匹配、依赖包冲…

作者头像 李华
网站建设 2026/7/1 19:18:21

图解说明:如何在LTspice中建立自定义二极管模型

如何在LTspice中精准构建自定义二极管模型&#xff1f;从参数提取到仿真验证的完整实战指南你有没有遇到过这样的情况&#xff1a;在设计一个高效率电源电路时&#xff0c;想用某款低反向恢复电荷的快恢复二极管&#xff0c;但LTspice里找不到它的模型&#xff1f;或者用了通用…

作者头像 李华
网站建设 2026/7/3 19:35:35

Sketch Palettes终极指南:5分钟掌握专业色彩管理

Sketch Palettes终极指南&#xff1a;5分钟掌握专业色彩管理 【免费下载链接】sketch-palettes A Sketch plugin for exporting and importing fill presets. It supports colors, gradients, and pattern fills. 项目地址: https://gitcode.com/gh_mirrors/sk/sketch-palett…

作者头像 李华
网站建设 2026/7/1 19:16:15

Cardinal:终极开源虚拟模块合成器插件完整指南

Cardinal&#xff1a;终极开源虚拟模块合成器插件完整指南 【免费下载链接】Cardinal Virtual modular synthesizer plugin 项目地址: https://gitcode.com/gh_mirrors/ca/Cardinal Cardinal是一款功能强大的免费开源虚拟模块合成器插件&#xff0c;支持AudioUnit、CLAP…

作者头像 李华