> For the complete documentation index, see [llms.txt](https://docs.convai.com/api-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/unity-plugin/building-for-supported-platforms/microphone-permission-issue-on-intel-macs-with-universal-builds.md).

# 为 macOS 通用应用构建

## 概述

在为 macOS 构建 Unity 项目时，开发者可能会遇到麦克风权限问题，尤其是在同时面向 Intel 和 Apple Silicon Mac 时。本文档概述了该问题、症状、原因和解决方案，以帮助确保在不同 Mac 架构上都能成功访问麦克风。

### 问题描述

一些用户报告称，在构建 macOS 通用应用时，Apple Silicon Mac 能够正常处理麦克风权限，而 Intel Mac 由于架构差异，可能无法访问麦克风。这可能导致麦克风无响应、DLL 找不到异常、错误消息、应用程序可能崩溃，或检测不到音频输入。

### 原因

该问题源于 `grpc_csharp_ext.bundle`，它对 Unity 项目中的网络通信至关重要。该 DLL 针对 Intel 和 Apple Silicon 架构有各自的版本，无法轻易合并或通用于所有架构。目前 grpc 库尚未针对在 Unity 中解决这些 dll 问题提供专门支持。

## 解决方案

### 独立版构建设置

* **对于 Intel Mac：** 使用专门面向 Intel 架构的独立版构建，以确保兼容性。
* **对于 Apple Silicon Mac：** 为了获得最佳性能，优先选择针对 ARM64 框架的独立版构建，不过 Universal 构建也是一种选择。

<figure><img src="/files/0ee0f076ff0599f07d37761ceec245cfb4aa885e" alt="" width="563"><figcaption></figcaption></figure>

### 从 Intel Mac 构建 Universal 版的新流程

在 Intel Mac 上完成 Universal 构建后，您必须手动更新 `grpc_csharp_ext.bundle` 以确保正常运行。请按以下步骤操作：

1. 找到 `.app` 文件，该文件由构建过程生成。<br>

   <figure><img src="/files/50016b0fcc7f305090e3d98c51b49e34e78b6d99" alt="" width="563"><figcaption></figcaption></figure>
2. 右键单击 `.app` 文件并选择“显示包内容”。\ <br>

   <figure><img src="/files/697c7b80e9fa1aa5cfe1b7450fe62e71b218c8b1" alt="" width="563"><figcaption></figcaption></figure>
3. 导航到 `Contents/Plugins` 包内的文件夹。\ <br>

   <figure><img src="/files/0d2cc38c05e7b5546d73acbb6589002e798a2709" alt="" width="563"><figcaption></figcaption></figure>
4. 将此文件夹的内容替换为所提供插件文件夹中的组件（[插件文件夹链接](https://drive.google.com/drive/folders/1oZSsFbd3SLSagJafwrLq1swdgL0Hr3Hm?usp=drive_link)).<br>

   <figure><img src="/files/ab510270e4d5167b51d631ebb8125dc72868533e" alt="" width="563"><figcaption></figcaption></figure>

   <figure><img src="/files/c8bcb2c44169be0ffdc35af313f7530ea3743854" alt="" width="563"><figcaption></figcaption></figure>

**重要：** 该 `grpc_csharp_ext.bundle` 在从 Intel Mac 构建时，可能不会正确包含在最终构建中。始终验证 `Plugins` 文件夹中包含的是正确的 DLL。如果有任何疑问或 DLL 缺失，请将 `Plugins` 文件夹的内容替换为我们提供的文件夹内容。

***

## 结论

为 macOS 构建需要仔细考虑 Intel 和 Apple Silicon 这两种不同架构。目前最佳实践是使用针对目标 Mac 特定架构定制的独立版构建设置。随着我们的推进，我们将提供一个更集成的 DLL 管理方案，从而简化通用 macOS 应用程序的开发流程。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/unity-plugin/building-for-supported-platforms/microphone-permission-issue-on-intel-macs-with-universal-builds.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
