I was looking into to minimize package size for mobile.
I saw on
that there is an option -compressed when cooking from commandline. Is this compressed option automatically used from the editor when building the package for shipping?
Unfortunately I am also unsure about how to cook for Android from command line, when I only want to use ETC1 for example. No matter what I try the build get stuck at GC and no folder is “Sandboxes” folder is created like it is mentioned for the output directory.
Sounds like you are doing cook on the fly, not just precooking (although I didn’t see that on that page). The GC line is normal for using cook on the fly, because the cooker starts up and then waits for a client (after collecting some garbage, aka GC).
Thanks, but still not working. Just to mention, the project packages fine from within the editor:
Here’s what I do:
In a dos window I go to the directory of my Engine in Engine/Binaries/Win64
UE4Editor -project=“Directory of my game including uproject file” -run=cook -targetplatform=Android_ETC1 -map=AllMaps -Compressed
Then a window pops up and goes trough a process very fast in 10s and closes automatically. So I dont see whats the error there. I tried to make a batch file with a PAUSE command to prevent automatic closing of the window, but as it opens a new dos window I cannot prevent it from closing I think.
No Etc Cooked Folder is created anywhere.
Edit: If the -compress option doesn’t do anything different than the In-Editor shipping conifugration, then I won’t bother with this problem anymore.
I have both my project and the unreal engine installed on a second hard drive. Don’t know if that is relevant here.
On my main hard drive under appdate/local a Android_ETC1 Folder is created after the build which only contains a Engine folder with a AssetRegistry.bin.
Again I am running the command from within my engine folder on the 2nd hard drive under Binaries\Win64, which I assume is correct.
Note that you already cooked, so I specified to skip cook, but if you want to cook and package at once, you would use -cook -AdditionalCookerOptions="-compressed"
(Note I haven’t tested the AdditionalCookerOptions in awhile, but this should work)
Ok so building is the same as cooking. Hope I got that right
I was just wondering about this compresse option, because always when uploading on google play it gives me the message that apk and obb could be more compressed.
When using both of the packaging commands I get the error below about a missing automation script. This is on 4.51, but I checked on 4.7, which also doesn’t have the script in the specified folder.
ScriptCompiler.LoadPreCompiledScriptAssemblies: ERROR: Scripts folder F:\UE4\Epic Games\4.5\Engine\Binaries\DotNET\AutomationScripts does not exist!
Program.Main: ERROR: AutomationTool terminated with exception:
Program.Main: ERROR: Exception in AutomationTool: AutomationScripts.Automation.dll was not found or could not be loaded, can’t run scripts.
Stacktrace: at AutomationTool.ScriptCompiler.LoadPreCompiledScriptAssemblies(List1 OutScriptAssemblies) at AutomationTool.ScriptCompiler.FindAndCompileAllScripts(List1 AdditionalScriptsFolders)
at AutomationTool.Automation.Process(String[] CommandLine)
at AutomationTool.Program.MainProc(Object Param)
at AutomationTool.InternalUtils.RunSingleInstance(MainProc Main, Object Param)
at AutomationTool.Program.Main()
Program.Main: ERROR: AutomationScripts.Automation.dll was not found or could not be loaded, can’t run scripts.
ProcessManager.KillAll: Trying to kill 0 spawned processes.
It might be nice to use packaging from command line, because then it would be maybe possible to delete some engine content which I am unable to delete at runtime. (To minimize apk/obb size)
Hi, I know it’s a bit late to write here, but I’m trying to do this myself. Achievement compile a. apk but when I open it in the device it asks for obb file, I do not know if I should specify that it must be created or created all packaged inside the apk.
the command you use is the following …