【发布时间】:2017-07-17 20:14:56
【问题描述】:
我的要求是在 PostProcessBuild 中执行一个 bash 脚本“PostProcessShellScript.sh”。 Unity 构建运行良好,但在 Unity Cloud Build 中构建失败。
下面是我的代码:
public static void OnPostProcessBuild(BuildTarget target, string pathToBuiltProject) {
.....
string scriptPath = Application.dataPath + "/Plugins/Android/Editor/PostProcessShellScript.sh";
//Runs fine on Local Unity build
//RunInShell("C:\\Program Files\\bash.exe","/" + scriptPath + " " + " " + "/" + apkPath + "/"+ "/" + apkName, false);
RunInShell("open","/" + scriptPath + " " + " " + "/" + apkPath + "/"+ "/" + apkName, false);
}
public static void RunInShell(string file, string args, bool waitForExit = true) {
System.Diagnostics.Process ppScriptProcess = new System.Diagnostics.Process();
ppScriptProcess.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Maximized;
ppScriptProcess.StartInfo.FileName = file;
ppScriptProcess.StartInfo.Arguments = args;
ppScriptProcess.StartInfo.UseShellExecute = false;
ppScriptProcess.StartInfo.CreateNoWindow = false;
ppScriptProcess.StartInfo.RedirectStandardOutput = true;
ppScriptProcess.StartInfo.RedirectStandardError = true;
ppScriptProcess.Start ()
}
关于 UCB 的错误详情:
! Unity 播放器导出失败!
! 'default_-android' 的构建失败。编译失败
为目标发布 surbhijain87/roll-a-ball-game 的 build 22 'default_-android'...
发布成功完成。
完成。
构建步骤 'Execute shell' 将构建标记为失败
postbuildstatus 成功完成。完成:失败
【问题讨论】:
-
你解决了吗?
标签: c# android bash unity3d unity3d-cloud-build