6
6
7
7
### Configure Xcode
8
8
9
+ ### 配置 Xcode
10
+
9
11
To develop Flutter apps for {{os}}, install Xcode to compile to native bytecode.
10
12
13
+ 要为 {{os}} 开发 Flutter 应用,
14
+ 请安装 Xcode,以便编译为原生字节码。
15
+
11
16
1 . To configure the command-line tools to use the installed version of Xcode,
12
17
run the following commands.
13
18
19
+ 请运行以下命令,
20
+ 来配置命令行工具使用已安装的 Xcode 版本。
21
+
14
22
``` terminal
15
23
{{prompt1}} sudo sh -c 'xcode-select -s /Applications/Xcode.app/Contents/Developer && xcodebuild -runFirstLaunch'
16
24
```
17
25
18
26
To use the latest version of Xcode, use this path.
19
27
If you need to use a different version, specify that path instead.
20
28
29
+ 使用以上路径来配置使用最新版本的 Xcode,
30
+ 如果你需要使用其他版本,请自行指定该路径。
31
+
21
32
{% if target=="mobile-ios" %}
22
33
23
34
1. To install the iOS Simulator, run the following command.
24
35
36
+ 请运行以下命令,来安装 iOS 模拟器。
37
+
25
38
```terminal
26
39
{{prompt1}} xcodebuild -downloadPlatform iOS
27
40
```
@@ -30,25 +43,34 @@ To develop Flutter apps for {{os}}, install Xcode to compile to native bytecode.
30
43
31
44
1. Sign the Xcode license agreement.
32
45
46
+ 签署 Xcode 许可证协议。
47
+
33
48
```terminal
34
49
{{prompt1}} sudo xcodebuild -license
35
50
```
36
51
37
52
Try to keep to the current version of Xcode.
38
53
54
+ 请尽量使用最新版本的 Xcode。
55
+
39
56
{% if target=="mobile-ios" %}
40
57
41
58
### Configure your target iOS device
42
59
60
+ ### 配置目标 iOS 设备
61
+
43
62
With Xcode, you can run Flutter apps on an iOS device or on the simulator.
44
63
64
+ 通过使用 Xcode,
65
+ 你可以在 iOS 真机设备或模拟器上运行 Flutter 应用。
66
+
45
67
{% comment %} Nav tabs {% endcomment -%}
46
68
<ul class="nav nav-tabs" id="ios-devices-vp" role="tablist">
47
69
<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>
49
71
</li>
50
72
<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>
52
74
</li>
53
75
</ul>
54
76
@@ -73,31 +95,53 @@ With Xcode, you can run Flutter apps on an iOS device or on the simulator.
73
95
74
96
### Install CocoaPods
75
97
98
+ ### 安装 CocoaPods
99
+
76
100
If your apps depend on [Flutter plugins][] with native {{os}} code,
77
101
install [CocoaPods][cocoapods].
78
102
This program bundles various dependencies across Flutter and {{os}} code.
79
103
104
+ 如果你的应用程序依赖于带有原生 {{os}} 代码的 [Flutter 插件][Flutter plugins],
105
+ 请安装 [CocoaPods][cocoapods]。
106
+ 该程序会捆绑 Flutter 和 {{os}} 代码之间的各种依赖关系。
107
+
80
108
To install and set up CocoaPods, run the following commands:
81
109
110
+ 请运行以下步骤,安装并设置 CocoaPods:
111
+
82
112
1. Install `cocoapods` following the
83
113
[CocoaPods install guide][cocoapods].
84
114
115
+ 按照 [CocoaPods 安装指南][cocoapods]
116
+ 安装 `cocoapods`。
117
+
85
118
```terminal
86
119
$ sudo gem install cocoapods
87
120
```
88
121
1 . Launch your preferred text editor.
89
122
123
+ 启动你喜欢的文本编辑器。
124
+
90
125
1 . Open the Zsh environmental variable file ` ~/.zshenv ` in your text editor.
91
126
127
+ 在文本编辑器中打开 Zsh 环境变量文件 ` ~/.zshenv ` 。
128
+
92
129
1 . Copy the following line and paste it at the end of your ` ~/.zshenv ` file.
93
130
131
+ 复制以下内容并粘贴到 ` ~/.zshenv ` 文件内的末尾。
132
+
94
133
``` conf
95
134
export PATH=$HOME/.gem/bin:$PATH
96
135
```
97
136
98
137
1 . Save your ` ~/.zshenv ` file.
99
138
139
+ 保存 ` ~/.zshenv ` 文件。
140
+
100
141
1 . To apply this change, restart all open terminal sessions.
101
142
143
+ 请重新启动所有打开的终端会话窗口,
144
+ 来应用此更改。
145
+
102
146
[ Flutter plugins ] : {{site.url}}/packages-and-plugins/developing-packages#types
103
147
[ cocoapods ] : https://guides.cocoapods.org/using/getting-started.html#installation
0 commit comments