| | |
| | | /// </summary>
|
| | | public static void ExportAndroidProject(string _publisher, int _buildIndex, bool _development, string _outputPath, string _assetBundlePath)
|
| | | {
|
| | | if (string.IsNullOrEmpty(_outputPath) || !Directory.Exists(_outputPath))
|
| | | {
|
| | | Debug.LogError("导出路径无效,请设置有效的 Android Export Path: " + _outputPath);
|
| | | return;
|
| | | }
|
| | |
|
| | | PreBuild(_publisher, _buildIndex);
|
| | |
|
| | | var versionName = string.Empty;
|
| | |
| | | // 关键设置:导出为Gradle工程而非直接打APK
|
| | | EditorUserBuildSettings.exportAsGoogleAndroidProject = true;
|
| | | EditorUserBuildSettings.androidBuildSystem = AndroidBuildSystem.Gradle;
|
| | | EditorUserBuildSettings.development = _development;
|
| | |
|
| | | // 导出路径
|
| | | // 导出路径(确保为绝对路径)
|
| | | _outputPath = Path.GetFullPath(_outputPath);
|
| | | string outputDir = Path.Combine(_outputPath, versionName + "_" + versionConfig.clientPackageFlag);
|
| | |
|
| | | if (Directory.Exists(outputDir))
|
| | |
| | |
|
| | | // 导出完成后恢复设置
|
| | | EditorUserBuildSettings.exportAsGoogleAndroidProject = false;
|
| | | EditorUserBuildSettings.development = false;
|
| | | }
|
| | |
|
| | | public static void BuildIpa(string _sdkPath, string _publisher, int _buildIndex, bool _replace)
|