66
77### Configure Xcode
88
9+ ### 配置 Xcode
10+
911To develop Flutter apps for {{os}}, install Xcode to compile to native bytecode.
1012
13+ 要为 {{os}} 开发 Flutter 应用,
14+ 请安装 Xcode,以便编译为原生字节码。
15+
11161 . To configure the command-line tools to use the installed version of Xcode,
1217 run the following commands.
1318
19+ 请运行以下命令,
20+ 来配置命令行工具使用已安装的 Xcode 版本。
21+
1422 ``` terminal
1523 {{prompt1}} sudo sh -c 'xcode-select -s /Applications/Xcode.app/Contents/Developer && xcodebuild -runFirstLaunch'
1624 ```
1725
1826 To use the latest version of Xcode, use this path.
1927 If you need to use a different version, specify that path instead.
2028
29+ 使用以上路径来配置使用最新版本的 Xcode,
30+ 如果你需要使用其他版本,请自行指定该路径。
31+
2132{% if target=="mobile-ios" %}
2233
23341. To install the iOS Simulator, run the following command.
2435
36+ 请运行以下命令,来安装 iOS 模拟器。
37+
2538 ```terminal
2639 {{prompt1}} xcodebuild -downloadPlatform iOS
2740 ```
@@ -30,25 +43,34 @@ To develop Flutter apps for {{os}}, install Xcode to compile to native bytecode.
3043
31441. Sign the Xcode license agreement.
3245
46+ 签署 Xcode 许可证协议。
47+
3348 ```terminal
3449 {{prompt1}} sudo xcodebuild -license
3550 ```
3651
3752Try to keep to the current version of Xcode.
3853
54+ 请尽量使用最新版本的 Xcode。
55+
3956{% if target=="mobile-ios" %}
4057
4158### Configure your target iOS device
4259
60+ ### 配置目标 iOS 设备
61+
4362With Xcode, you can run Flutter apps on an iOS device or on the simulator.
4463
64+ 通过使用 Xcode,
65+ 你可以在 iOS 真机设备或模拟器上运行 Flutter 应用。
66+
4567{% comment %} Nav tabs {% endcomment -%}
4668<ul class="nav nav-tabs" id="ios-devices-vp" role="tablist">
4769 <li class="nav-item">
48- <a class="nav-link active" id="virtual-tab" href="#virtual" role="tab" aria-controls="virtual" aria-selected="true">Virtual Device </a>
70+ <a class="nav-link active" id="virtual-tab" href="#virtual" role="tab" aria-controls="virtual" aria-selected="true">虚拟设备 </a>
4971 </li>
5072 <li class="nav-item">
51- <a class="nav-link" id="physical-tab" href="#physical" role="tab" aria-controls="physical" aria-selected="false">Physical Device </a>
73+ <a class="nav-link" id="physical-tab" href="#physical" role="tab" aria-controls="physical" aria-selected="false">真机设备 </a>
5274 </li>
5375</ul>
5476
@@ -73,31 +95,53 @@ With Xcode, you can run Flutter apps on an iOS device or on the simulator.
7395
7496### Install CocoaPods
7597
98+ ### 安装 CocoaPods
99+
76100If your apps depend on [Flutter plugins][] with native {{os}} code,
77101install [CocoaPods][cocoapods].
78102This program bundles various dependencies across Flutter and {{os}} code.
79103
104+ 如果你的应用程序依赖于带有原生 {{os}} 代码的 [Flutter 插件][Flutter plugins],
105+ 请安装 [CocoaPods][cocoapods]。
106+ 该程序会捆绑 Flutter 和 {{os}} 代码之间的各种依赖关系。
107+
80108To install and set up CocoaPods, run the following commands:
81109
110+ 请运行以下步骤,安装并设置 CocoaPods:
111+
821121. Install `cocoapods` following the
83113 [CocoaPods install guide][cocoapods].
84114
115+ 按照 [CocoaPods 安装指南][cocoapods]
116+ 安装 `cocoapods`。
117+
85118 ```terminal
86119 $ sudo gem install cocoapods
87120 ```
881211 . Launch your preferred text editor.
89122
123+ 启动你喜欢的文本编辑器。
124+
901251 . Open the Zsh environmental variable file ` ~/.zshenv ` in your text editor.
91126
127+ 在文本编辑器中打开 Zsh 环境变量文件 ` ~/.zshenv ` 。
128+
921291 . Copy the following line and paste it at the end of your ` ~/.zshenv ` file.
93130
131+ 复制以下内容并粘贴到 ` ~/.zshenv ` 文件内的末尾。
132+
94133 ``` conf
95134 export PATH=$HOME/.gem/bin:$PATH
96135 ```
97136
981371 . Save your ` ~/.zshenv ` file.
99138
139+ 保存 ` ~/.zshenv ` 文件。
140+
1001411 . To apply this change, restart all open terminal sessions.
101142
143+ 请重新启动所有打开的终端会话窗口,
144+ 来应用此更改。
145+
102146[ Flutter plugins ] : {{site.url}}/packages-and-plugins/developing-packages#types
103147[ cocoapods ] : https://guides.cocoapods.org/using/getting-started.html#installation
0 commit comments