Skip to content

Commit 1c4daf9

Browse files
authored
Merge pull request #3218 from yanOO1497/7_11_update_
update android docs
2 parents 987168a + 586f216 commit 1c4daf9

File tree

2 files changed

+108
-5
lines changed

2 files changed

+108
-5
lines changed

versions/3.8/en/editor/publish/android/build-options-android.md

Lines changed: 57 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,12 @@ The build options for the Android platform are as follows:
1010

1111
This option actively adjusts the rendering time to match the screen refresh rate, achieving stable frame rates and reducing unnecessary rendering. The build parameter is `swappy`.
1212

13-
For more information, refer to the official documentation on [Frame Pacing Library Overview](https://source.android.com/devices/graphics/frame-pacing)
13+
For more information, refer to the official documentation on [Frame Pacing Library Overview](https://source.android.com/devices/graphics/frame-pacing).
1414

1515
## Render Backend
1616

1717
Currently supported options are as follows:
18+
1819
- [VULKAN](https://www.vulkan.org/)
1920
- [GLES3](https://www.khronos.org/registry/OpenGL-Refpages/es3/)
2021
- [GLES2](https://www.khronos.org/registry/OpenGL-Refpages/es2.0/)
@@ -39,16 +40,16 @@ Set the Target API Level required for Android platform compilation. Clicking the
3940

4041
Set the CPU types that your Android app needs to support. You can choose one or more options, including `armeabi-v7a`, `arm64-v8a`, `x86`, and `x86_64`.
4142

42-
**Note**:
43+
**Notes**:
4344

44-
1. When you select one ABI and build it without cleaning, both ABIs' shared objects (so) will be packaged into the APK. This is the default behavior of Android Studio. If you import the project into Android Studio, after building one ABI, perform **Build -> Clean Project** before building another ABI. This way, only the latter ABI will be packaged into the APK
45+
1. When you select one ABI and build it without cleaning, both ABIs' shared objects (so) will be packaged into the APK. This is the default behavior of Android Studio. If you import the project into Android Studio, after building one ABI, perform **Build -> Clean Project** before building another ABI. This way, only the latter ABI will be packaged into the APK.
4546

4647
2. After importing the project into Android Studio, it exists independently and is not dependent on the build and release panel. If you need to modify the ABI, directly modify the **PROP_APP_ABI** property in the `gradle.properties` file.
4748
![modify abi](../publish-native/modify_abi.png)
4849

4950
## Use Debug Keystore
5051

51-
Android requires that all APKs be digitally signed with a certificate before they can be installed. Cocos Creator provides a default keystore, and checking **Use Debug Keystore** means using the default keystore. If developers need a custom keystore, uncheck **Use Debug Keystore**. For more details, refer to the [Android Developer - App Signing](https://developer.android.google.cn/studio/publish/app-signing)
52+
Android requires that all APKs be digitally signed with a certificate before they can be installed. Cocos Creator provides a default keystore, and checking **Use Debug Keystore** means using the default keystore. If developers need a custom keystore, uncheck **Use Debug Keystore**. For more details, refer to the [Android Developer - App Signing](https://developer.android.google.cn/studio/publish/app-signing).
5253

5354
## Orientation
5455

@@ -63,11 +64,62 @@ The screen orientation currently includes three options: **Portrait**, **Landsca
6364
Checking this option allows you to package and publish your game to Google Play Instant. Google Play Instant is dependent on Google Play and is not a separate distribution channel but rather a game streaming solution. It enables players to try, share, and engage with your game instantly without the need to install it.
6465

6566
**Note the following points when using Google Play Instant:**
67+
6668
1. Android Studio version should be 4.0 or above.
6769
2. Android phones running Android 6.0 or above. Devices with Android SDK versions between 6.0 and 7.0 require the installation of Google Play Services Framework, while devices with SDK versions 8.0 or above do not require it and can use the services directly.
6870
3. For the first build, you need to open the built project with Android Studio to download the Google Play Instant Development SDK (Windows) or Instant Apps Development SDK (Mac) support package. If the download fails, it is recommended to set up an HTTP proxy for Android Studio.
6971
![Google Play Instant](../publish-native/sdk-android-instant.png)
7072

7173
## Generate App Bundle(Google Play)
7274

73-
Checking this option allows you to package your game as an App Bundle format for uploading to the Google Play Store. For more information, refer to the [Android Developer - App Bundle](https://developer.android.google.cn/guide/app-bundle/)
75+
Checking this option allows you to package your game as an App Bundle format for uploading to the Google Play Store. For more information, refer to the [Android Developer - App Bundle](https://developer.android.google.cn/guide/app-bundle/).
76+
77+
## Other Options
78+
79+
Some SDK and NDK options need to be set in the preferences. In addition to setting them in the preferences, you can also pass specified parameters through the build command line.
80+
81+
**sdkPath**: Specify the SDK path
82+
**ndkPath**: Specify the NDK path
83+
84+
You can export the build configuration and add the corresponding parameters in the Android options.
85+
86+
## Build Parameter Interface Definition (used to modify parameters during command line builds)
87+
88+
```ts
89+
interface IOptions {
90+
packageName: string;
91+
resizeableActivity: boolean;
92+
maxAspectRatio: string;
93+
orientation: {
94+
landscapeRight: boolean;
95+
landscapeLeft: boolean;
96+
portrait: boolean;
97+
upsideDown: boolean;
98+
},
99+
100+
apiLevel: number;
101+
appABIs: IAppABI[];
102+
103+
useDebugKeystore: boolean;
104+
keystorePath: string;
105+
keystorePassword: string;
106+
keystoreAlias: string;
107+
keystoreAliasPassword: string;
108+
109+
appBundle: boolean;
110+
androidInstant: boolean;
111+
inputSDK: boolean;
112+
remoteUrl: string;
113+
sdkPath: string;
114+
ndkPath: string;
115+
javaHome?: string;
116+
javaPath?: string;
117+
118+
swappy: boolean;
119+
120+
renderBackEnd: {
121+
vulkan: boolean;
122+
gles3: boolean;
123+
gles2: boolean;
124+
}
125+
}

versions/3.8/zh/editor/publish/android/build-options-android.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,3 +71,54 @@ Android 要求所有 APK 必须先使用证书进行数字签署,然后才能
7171
## 生成 App Bundle(Google Play)
7272

7373
勾选该项即可将游戏打包成 App Bundle 格式用于上传到 Google Play 商店。具体请参考 [官方文档](https://developer.android.google.cn/guide/app-bundle/)
74+
75+
## 其他选项
76+
77+
安卓有部分 SDK,NDK 选项需要在偏好设置里设置,除了在偏好设置以外还可以通过构建参数传递指定。
78+
79+
**sdkPath**: 指定 SDK 路径
80+
**ndkPath**: 指定 NDK 路径
81+
82+
可以通过导出构建配置,并在安卓对应的选项内添加参数即可。
83+
84+
## 构建参数接口定义(用于命令行构建修改参数)
85+
86+
```ts
87+
interface IOptions {
88+
packageName: string;
89+
resizeableActivity: boolean;
90+
maxAspectRatio: string;
91+
orientation: {
92+
landscapeRight: boolean;
93+
landscapeLeft: boolean;
94+
portrait: boolean;
95+
upsideDown: boolean;
96+
},
97+
98+
apiLevel: number;
99+
appABIs: IAppABI[];
100+
101+
useDebugKeystore: boolean;
102+
keystorePath: string;
103+
keystorePassword: string;
104+
keystoreAlias: string;
105+
keystoreAliasPassword: string;
106+
107+
appBundle: boolean;
108+
androidInstant: boolean;
109+
inputSDK: boolean;
110+
remoteUrl: string;
111+
sdkPath: string;
112+
ndkPath: string;
113+
javaHome?: string;
114+
javaPath?: string;
115+
116+
swappy: boolean;
117+
118+
renderBackEnd: {
119+
vulkan: boolean;
120+
gles3: boolean;
121+
gles2: boolean;
122+
}
123+
}
124+
```

0 commit comments

Comments
 (0)