Skip to content

Commit 66fae34

Browse files
committed
update
1 parent 444c39a commit 66fae34

16 files changed

+761
-611
lines changed

cndocs/_getting-started-linux-android.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,18 +71,18 @@ React Native 当前需要 Java Development Kit [JDK] 17。你可以在命令行
7171

7272
<h4 id="android-sdk">2. 安装 Android SDK</h4>
7373

74-
Android Studio 默认会安装最新版本的 Android SDK。目前编译 React Native 应用需要的是`Android 14 (UpsideDownCake)`版本的 SDK(注意 SDK 版本不等于终端系统版本,RN 目前支持 android 6 以上设备)。你可以在 Android Studio 的 SDK Manager 中选择安装各版本的 SDK。
74+
Android Studio 默认会安装最新版本的 Android SDK。目前编译 React Native 应用需要的是`Android 15 (VanillaIceCream)`版本的 SDK(注意 SDK 版本不等于终端系统版本,RN 目前支持 android 6 以上设备)。你可以在 Android Studio 的 SDK Manager 中选择安装各版本的 SDK。
7575

7676
你可以在 Android Studio 的欢迎界面中找到 SDK Manager。点击"Configure",然后就能看到"SDK Manager"。
7777

7878
> SDK Manager 还可以在 Android Studio 的"Preferences"菜单中找到。具体路径是**Appearance & Behavior****System Settings****Android SDK**
7979
80-
在 SDK Manager 中选择"SDK Platforms"选项卡,然后在右下角勾选"Show Package Details"。展开`Android 14 (UpsideDownCake)`选项,确保勾选了下面这些组件(如果看不到这个界面,则需要使用稳定的代理软件):
80+
在 SDK Manager 中选择"SDK Platforms"选项卡,然后在右下角勾选"Show Package Details"。展开`Android 15 (VanillaIceCream)`选项,确保勾选了下面这些组件(如果看不到这个界面,则需要使用稳定的代理软件):
8181

82-
- `Android SDK Platform 34`
82+
- `Android SDK Platform 35`
8383
- `Intel x86 Atom_64 System Image`(官方模拟器镜像文件,使用非官方模拟器不需要安装此组件)
8484

85-
然后点击"SDK Tools"选项卡,同样勾中右下角的"Show Package Details"。展开"Android SDK Build-Tools"选项,确保选中了 React Native 所必须的`34.0.0`版本。你可以同时安装多个其他版本。
85+
然后点击"SDK Tools"选项卡,同样勾中右下角的"Show Package Details"。展开"Android SDK Build-Tools"选项,确保选中了 React Native 所必须的`35.0.0`版本。你可以同时安装多个其他版本。
8686

8787
最后点击"Apply"来下载和安装这些组件。
8888

cndocs/_getting-started-macos-android.md

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,22 @@ npm install -g yarn
4848
```shell
4949
brew install --cask zulu@17
5050

51-
# Get path to where cask was installed to double-click installer
51+
# 获得 JDK 安装程序的路径
5252
brew info --cask zulu@17
53+
54+
# ==> zulu@17: <版本号>
55+
# https://www.azul.com/downloads/
56+
# Installed
57+
# /opt/homebrew/Caskroom/zulu@17/<版本号> (185.8MB) (注意在 Intel 芯片的 Mac 上,路径可能是 /usr/local/Caskroom/zulu@17/<版本号>)
58+
# Installed using the formulae.brew.sh API on 2024-06-06 at 10:00:00
59+
60+
# 导航到上面打印出来的路径
61+
open /opt/homebrew/Caskroom/zulu@17/<版本号>
62+
# 或者可能是 /usr/local/Caskroom/zulu@17/<版本号>
5363
```
5464

65+
打开 Finder,双击 `Double-Click to Install Azul Zulu JDK 17.pkg` 包来安装 JDK。
66+
5567
安装 JDK 后,请更新 `JAVA_HOME` 环境变量。如果你是按照上述步骤操作,JDK 很可能位于 `/Library/Java/JavaVirtualMachines/zulu-17.jdk/Contents/Home`
5668

5769
React Native 当前需要 Java Development Kit [JDK] 17,不建议使用更高版本或更低版本,可能会碰到问题。你可以在命令行中输入
@@ -83,20 +95,20 @@ React Native 当前需要 Java Development Kit [JDK] 17,不建议使用更高
8395

8496
<h4 id="android-sdk">2. 安装 Android SDK</h4>
8597

86-
Android Studio 默认会安装最新版本的 Android SDK。目前编译 React Native 应用需要的是`Android 14 (UpsideDownCake)`版本的 SDK(注意 SDK 版本不等于终端系统版本,RN 目前支持 android 6 以上设备)。你可以在 Android Studio 的 SDK Manager 中选择安装各版本的 SDK。
98+
Android Studio 默认会安装最新版本的 Android SDK。目前编译 React Native 应用需要的是`Android 15 (VanillaIceCream)`版本的 SDK(注意 SDK 版本不等于终端系统版本,RN 目前支持 android 6 以上设备)。你可以在 Android Studio 的 SDK Manager 中选择安装各版本的 SDK。
8799

88100
你可以在 Android Studio 的欢迎界面中找到 SDK Manager。点击"Configure",然后就能看到"SDK Manager"。
89101

90102
![Android Studio Welcome](/docs/assets/GettingStartedAndroidStudioWelcomeMacOS.png)
91103

92104
> SDK Manager 还可以在 Android Studio 的"Preferences"菜单中找到。具体路径是**Appearance & Behavior****System Settings****Android SDK**
93105
94-
在 SDK Manager 中选择"SDK Platforms"选项卡,然后在右下角勾选"Show Package Details"。展开`Android 14 (UpsideDownCake)`选项,确保勾选了下面这些组件(如果看不到这个界面,则需要使用稳定的代理软件):
106+
在 SDK Manager 中选择"SDK Platforms"选项卡,然后在右下角勾选"Show Package Details"。展开`Android 15 (VanillaIceCream)`选项,确保勾选了下面这些组件(如果看不到这个界面,则需要使用稳定的代理软件):
95107

96-
- `Android SDK Platform 34`
97-
- `Intel x86 Atom_64 System Image`官方模拟器镜像文件,使用非官方模拟器不需要安装此组件)或是`Google APIs ARM 64 v8a System Image`(针对 Apple Silicon 系列机型)
108+
- `Android SDK Platform 35`
109+
- `Intel x86 Atom_64 System Image`针对 Intel 芯片的官方模拟器镜像文件,使用非官方模拟器不需要安装此组件)或是`Google APIs ARM 64 v8a System Image`(针对 Apple Silicon 系列机型)
98110

99-
然后点击"SDK Tools"选项卡,同样勾中右下角的"Show Package Details"。展开"Android SDK Build-Tools"选项,确保选中了 React Native 所必须的`34.0.0`版本。你可以同时安装多个其他版本。
111+
然后点击"SDK Tools"选项卡,同样勾中右下角的"Show Package Details"。展开"Android SDK Build-Tools"选项,确保选中了 React Native 所必须的`35.0.0`版本。你可以同时安装多个其他版本。
100112

101113
点击"Apply"来下载和安装选中的这些组件。
102114

cndocs/_getting-started-macos-ios.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ npm install -g yarn
4343

4444
### Xcode
4545

46-
React Native 目前需要[Xcode](https://developer.apple.com/xcode/downloads/) 14.1 或更高版本。你可以通过 App Store 或是到[Apple 开发者官网](https://developer.apple.com/xcode/downloads/)上下载。这一步骤会同时安装 Xcode IDE、Xcode 的命令行工具和 iOS 模拟器。
46+
React Native 目前需要[Xcode](https://developer.apple.com/xcode/downloads/) 14.1 或更高版本(建议选择尽量新的版本)。你可以通过 App Store 或是到[Apple 开发者官网](https://developer.apple.com/xcode/downloads/)上下载。这一步骤会同时安装 Xcode IDE、Xcode 的命令行工具和 iOS 模拟器。
4747

4848
#### Xcode 的命令行工具
4949

cndocs/_getting-started-windows-android.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,20 +63,20 @@ npm install -g yarn
6363

6464
#### 2. 安装 Android SDK
6565

66-
Android Studio 默认会安装最新版本的 Android SDK。目前编译 React Native 应用需要的是`Android 14 (UpsideDownCake)`版本的 SDK(注意 SDK 版本不等于终端系统版本,RN 目前支持 android 6 以上设备)。你可以在 Android Studio 的 SDK Manager 中选择安装各版本的 SDK。
66+
Android Studio 默认会安装最新版本的 Android SDK。目前编译 React Native 应用需要的是`Android 15 (VanillaIceCream)`版本的 SDK(注意 SDK 版本不等于终端系统版本,RN 目前支持 android 6 以上设备)。你可以在 Android Studio 的 SDK Manager 中选择安装各版本的 SDK。
6767

6868
你可以在 Android Studio 的欢迎界面中找到 SDK Manager。点击"Configure",然后就能看到"SDK Manager"。
6969

7070
![Android Studio Welcome](/docs/assets/GettingStartedAndroidStudioWelcomeWindows.png)
7171

7272
> SDK Manager 还可以在 Android Studio 的"Preferences"菜单中找到。具体路径是**Appearance & Behavior****System Settings****Android SDK**
7373
74-
在 SDK Manager 中选择"SDK Platforms"选项卡,然后在右下角勾选"Show Package Details"。展开`Android 14 (UpsideDownCake)`选项,确保勾选了下面这些组件(如果你看不到这个界面,则需要使用稳定的代理软件):
74+
在 SDK Manager 中选择"SDK Platforms"选项卡,然后在右下角勾选"Show Package Details"。展开`Android 15 (VanillaIceCream)`选项,确保勾选了下面这些组件(如果你看不到这个界面,则需要使用稳定的代理软件):
7575

76-
- `Android SDK Platform 34`
76+
- `Android SDK Platform 35`
7777
- `Intel x86 Atom_64 System Image`(官方模拟器镜像文件,使用非官方模拟器不需要安装此组件)
7878

79-
然后点击"SDK Tools"选项卡,同样勾中右下角的"Show Package Details"。展开"Android SDK Build-Tools"选项,确保选中了 React Native 所必须的`34.0.0`版本。你可以同时安装多个其他版本。
79+
然后点击"SDK Tools"选项卡,同样勾中右下角的"Show Package Details"。展开"Android SDK Build-Tools"选项,确保选中了 React Native 所必须的`35.0.0`版本。你可以同时安装多个其他版本。
8080

8181
最后点击"Apply"来下载和安装这些组件。
8282

cndocs/_integration-with-existing-apps-ios.md

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; import con
2929
进入根目录并运行以下命令:
3030

3131
```
32-
curl -O https://raw.githubusercontent.com/react-native-community/template/refs/heads/0.76-stable/template/package.json
32+
curl -O https://raw.githubusercontent.com/react-native-community/template/refs/heads/0.77-stable/template/package.json
3333
```
3434

35-
这将从[社区模板](https://github.com/react-native-community/template/blob/0.76-stable/template/package.json) 复制 `package.json` 文件到您的项目中。
35+
这将从[社区模板](https://github.com/react-native-community/template/blob/0.77-stable/template/package.json) 复制 `package.json` 文件到您的项目中。
3636

3737
接下来,运行以下命令安装 NPM 包:
3838

@@ -55,7 +55,7 @@ yarn install
5555

5656
安装过程创建了一个新的 `node_modules` 文件夹。该文件夹存储了构建项目所需的 JavaScript 依赖项。
5757

58-
`node_modules/` 添加到您的 `.gitignore` 文件中([社区默认文件](https://github.com/react-native-community/template/blob/0.76-stable/template/_gitignore))。
58+
`node_modules/` 添加到您的 `.gitignore` 文件中([社区默认文件](https://github.com/react-native-community/template/blob/0.77-stable/template/_gitignore))。
5959

6060
### 3. 安装开发工具
6161

@@ -87,22 +87,22 @@ brew install cocoapods
8787
对于 **Gemfile**,请进入您的项目根目录并运行以下命令:
8888

8989
```sh
90-
curl -O https://raw.githubusercontent.com/react-native-community/template/refs/heads/0.76-stable/template/Gemfile
90+
curl -O https://raw.githubusercontent.com/react-native-community/template/refs/heads/0.77-stable/template/Gemfile
9191
```
9292

9393
这将下载 Gemfile 文件。
9494
对于 **Podfile**,请进入您的项目 `ios` 文件夹并运行以下命令:
9595

9696
```sh
97-
curl -O https://raw.githubusercontent.com/react-native-community/template/refs/heads/0.76-stable/template/ios/Podfile
97+
curl -O https://raw.githubusercontent.com/react-native-community/template/refs/heads/0.77-stable/template/ios/Podfile
9898
```
9999

100-
请使用社区模板 作为 [Gemfile](https://github.com/react-native-community/template/blob/0.76-stable/template/Gemfile)[Podfile](https://github.com/react-native-community/template/blob/0.76-stable/template/ios/Podfile) 的参考。
100+
请使用社区模板 作为 [Gemfile](https://github.com/react-native-community/template/blob/0.77-stable/template/Gemfile)[Podfile](https://github.com/react-native-community/template/blob/0.77-stable/template/ios/Podfile) 的参考。
101101

102102
:::note
103-
请记住更改 [Podfile](https://github.com/react-native-community/template/blob/0.76-stable/template/ios/Podfile#L17)[Podfile](https://github.com/react-native-community/template/blob/0.76-stable/template/ios/Podfile#L26) 中的这两行,以匹配您的应用名称。
103+
请记住更改 [Podfile](https://github.com/react-native-community/template/blob/0.77-stable/template/ios/Podfile#L17)[Podfile](https://github.com/react-native-community/template/blob/0.77-stable/template/ios/Podfile#L26) 中的这两行,以匹配您的应用名称。
104104

105-
如果您的应用没有测试,请记住删除 [Podfile](https://github.com/react-native-community/template/blob/0.76-stable/template/ios/Podfile#L26-L29) 中的这段代码。
105+
如果您的应用没有测试,请记住删除 [Podfile](https://github.com/react-native-community/template/blob/0.77-stable/template/ios/Podfile#L26-L29) 中的这段代码。
106106
:::
107107

108108
现在,我们需要运行一些额外的命令来安装 Ruby Gem 和 Pods。
@@ -127,7 +127,7 @@ bundle exec pod install
127127

128128
`index.js` 是 React Native 应用程序的起点,并且总是需要。它可以是一个小文件,该文件 `import` 其他文件,这些文件是您的 React Native 组件或应用程序的一部分,或者它可以包含所有需要的代码。
129129

130-
我们的 `index.js` 文件应如下所示([社区模板文件](https://github.com/react-native-community/template/blob/0.76-stable/template/index.js) 作为参考):
130+
我们的 `index.js` 文件应如下所示([社区模板文件](https://github.com/react-native-community/template/blob/0.77-stable/template/index.js) 作为参考):
131131

132132
```js
133133
import {AppRegistry} from 'react-native';
@@ -138,7 +138,7 @@ AppRegistry.registerComponent('HelloWorld', () => App);
138138

139139
### 创建一个 `App.tsx` 文件
140140

141-
让我们创建一个 `App.tsx` 文件。这是一个 [TypeScript](https://www.typescriptlang.org/) 文件,可以包含 [JSX](<https://en.wikipedia.org/wiki/JSX_(JavaScript)>) 表达式。它包含我们要集成到 iOS 应用程序中的根 React Native 组件([链接](https://github.com/react-native-community/template/blob/0.76-stable/template/App.tsx)):
141+
让我们创建一个 `App.tsx` 文件。这是一个 [TypeScript](https://www.typescriptlang.org/) 文件,可以包含 [JSX](<https://en.wikipedia.org/wiki/JSX_(JavaScript)>) 表达式。它包含我们要集成到 iOS 应用程序中的根 React Native 组件([链接](https://github.com/react-native-community/template/blob/0.77-stable/template/App.tsx)):
142142

143143
```tsx
144144
import React from 'react';
@@ -211,7 +211,7 @@ const styles = StyleSheet.create({
211211
export default App;
212212
```
213213

214-
[社区模板文件](https://github.com/react-native-community/template/blob/0.76-stable/template/App.tsx) 作为参考
214+
[社区模板文件](https://github.com/react-native-community/template/blob/0.77-stable/template/App.tsx) 作为参考
215215

216216
## 5. 与 iOS 代码集成
217217

@@ -349,7 +349,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
349349
```diff title="AppDelegate.swift"
350350
import UIKit
351351
+import React_RCTAppDelegate
352-
+import React_RCTAppDelegate
353352

354353
@main
355354
-class AppDelegate: UIResponder, UIApplicationDelegate {
@@ -551,7 +550,7 @@ const {getDefaultConfig} = require('@react-native/metro-config');
551550
module.exports = getDefaultConfig(__dirname);
552551
```
553552

554-
您可以查看[社区模板文件](https://github.com/react-native-community/template/blob/0.76-stable/template/metro.config.js) 作为参考。
553+
您可以查看[社区模板文件](https://github.com/react-native-community/template/blob/0.77-stable/template/metro.config.js) 作为参考。
555554

556555
一旦您有了配置文件,您可以运行 bundler。在项目根目录下运行以下命令:
557556

0 commit comments

Comments
 (0)