# iOS 建置

## 建構 iOS

<figure><img src="/files/fUHT01RrQUPTzyQACaPC" alt=""><figcaption></figcaption></figure>

在 Mac 上，為您正在處理的項目選擇<mark style="color:orange;">File</mark> -> <mark style="color:orange;">Build Settings</mark>。

<figure><img src="/files/zhF1nehpI2oddPtnPdVK" alt=""><figcaption></figcaption></figure>

從<mark style="color:orange;">Build Settings</mark>中的<mark style="color:orange;">Platform</mark>選單中選擇“iOS”，然後按一下<mark style="color:orange;">switch Platform</mark>。

<figure><img src="/files/xUQIYnp0p7N411KPqVds" alt=""><figcaption></figcaption></figure>

當Platform發生變化時，按一&#x4E0B;***Build***&#x6309;鈕可以選擇Build檔案的儲存位置。

( Build資料夾是透過**New Folder**建立的檔案。)

<figure><img src="/files/hRzHGNaacDwRTwsTOxie" alt=""><figcaption></figcaption></figure>

檢查透過Unity建立的Xcode專案檔案後

<figure><img src="/files/VZWhByfIZhQaOXYvulez" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/Lzcn6uLYNY1sGQzVpI2S" alt=""><figcaption></figcaption></figure>

從 ProudNet 所在的資料夾複製 <mark style="color:orange;">ProudNet</mark> -> <mark style="color:orange;">include</mark> 資料夾中的所有檔案。

<figure><img src="/files/toaVu4z47dTEmJGiTF7P" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/LDnTrJcWipC53Ku3v7zc" alt=""><figcaption></figcaption></figure>

將所有複製的檔案貼到使用 Unity 建立的 Xcode 專案資料夾中的 **Libraries** 中。

<figure><img src="/files/jsBinxKzDlvGvjzN0o7c" alt=""><figcaption><p>ProudNetClientPlugin_wrap.cxx 文件複製</p></figcaption></figure>

<figure><img src="/files/aKVrCzo5TEMC6b5JM0Fx" alt=""><figcaption></figcaption></figure>

再次將 <mark style="color:orange;">ProudNet</mark> -> <mark style="color:orange;">lib</mark> -> <mark style="color:orange;">Plugins</mark> -> <mark style="color:orange;">Unity</mark> -> <mark style="color:orange;">iOS</mark> 資料夾中的 <mark style="color:orange;">ProudNetClientPlugin\_wrap.cxx</mark> 檔案複製到 ProudNet 所在資料夾中，

<figure><img src="/files/I4122qimR1xnmNvFYzqJ" alt=""><figcaption><p>專案路徑 - Build - Libraries - Plugins - Unity - IOS </p></figcaption></figure>

<figure><img src="/files/2SnU2d7t5qxaQC67tqVp" alt=""><figcaption></figcaption></figure>

貼到 <mark style="color:orange;">Build</mark> -> <mark style="color:orange;">Libraries</mark> -> <mark style="color:orange;">Plugins</mark> -> <mark style="color:orange;">Unity</mark> -> <mark style="color:orange;">iOS</mark> 文件夾中。

<figure><img src="/files/voAISbtOUCzLIeQm95RC" alt=""><figcaption></figcaption></figure>

開啟Xcode項目，在**TARGETS**選單中選擇<mark style="color:orange;">UnityFramework</mark> -> <mark style="color:orange;">Build Settings</mark>，然後在**Search Paths**選單中加入**Header Search Paths**。

<figure><img src="/files/S0Tdqrmpwq4qtJLlNKUl" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/2n7cuTdqPZxEp4j1MRe5" alt=""><figcaption></figcaption></figure>

您新增的路徑是包含從 ProudNet 匯入的檔案的資料夾。

<figure><img src="/files/L1LsKmMcr9XvENooDdaQ" alt=""><figcaption></figcaption></figure>

點擊 Xcode -> **Product** 選單中的 **Build** 以建立 iOS 建置檔。

## 可能發生的錯誤

如果出現以下錯誤，您必須按照以下方式在**隱私權與安全性**中解鎖。

<figure><img src="/files/2Qgrhl5JqHVzCw5HJnvm" alt=""><figcaption></figcaption></figure>

如果出現以上錯誤&#x20;

<figure><img src="/files/hFcgWBHP9xV4razK9Nfr" alt=""><figcaption></figcaption></figure>

在<mark style="color:orange;">系統設定</mark> -> <mark style="color:orange;">隱私權與安全性</mark> -> <mark style="color:orange;">安全性</mark>標籤中，按一&#x4E0B;***仍允許***&#x4EE5;取消封鎖 <mark style="color:orange;">ProudNetClientPlugin.bundle</mark>。

***

## :arrow\_left: [返回](/proudnet.cn/proudnet/2.setting/unity3d.md#ios)


---

# Agent Instructions: 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.proudnet.com/proudnet.cn/proudnet/2.setting/unity3d/ios-jian-zhi.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.
