UE4 continuous integration packaging (Mac script automated packaging)

 

It is mainly packaged through RunUAT. Both win and mac can be packaged. This package is implemented in the Mac environment, using /Engine/Build/BatchFiles/RunUAT.sh

Reference command format (Reference 1):

RunUAT BuildCookRun -project="full_project_path_and_project_name.uproject" -noP4 -platform=Win64 -clientconfig=Development -serverconfig=Development -cook -allmaps -build -stage -pak -archive -archivedirectory="Output Directory"

The specific parameters will be output on the console at the beginning of the construction of UE4's launch, and you can refer to them.

Among them, RunUAT needs to write the full path, my build command is as follows, the output apk is in the /Binaries/Android/ folder by default

"/Users/Shared/Epic Games/UE_4.21/Engine/Build/BatchFiles/RunUAT.sh" BuildCookRun  -project=/Demo_ForMac_Android/Demo.uproject -noP4 -clientconfig=Development -serverconfig=Development -nocompile -nocompileeditor -installed -ue4exe=UE4Editor -utf8output -platform=Android_ASTC -targetplatform=Android -cookflavor=ASTC -build -map=/Game/Maps/NewMap1 -skipcook -compressed -stage

Supplement ipa

"/Users/Shared/Epic Games/UE_4.22/Engine/Build/BatchFiles/RunUAT.sh" BuildCookRun -project="/export/jenkins/workspace/Demo_ForMac_iOS2/Demo/Demo.uproject" -noP4 -clientconfig=Development -serverconfig=Development -nocompile -nocompileeditor -ue4exe='/Users/Shared/Epic Games/UE_4.22/Engine/Binaries/Mac/UE4Editor.app/Contents/MacOS/UE4Editor' -utf8output -platform=IOS -build -map=/Game/Maps/NewMap -skipcook -CookInEditor -iterativecooking -compressed -stage

 

references:

1、https://wiki.unrealengine.com/How_to_package_your_game_with_commands

2. https://api.unrealengine.com/CHN/Engine/Basics/Projects/Packaging/index.html (not used, detailed description)

3、https://www.jianshu.com/p/8e2b0da24d8d

4、https://www.jianshu.com/p/b3954b2ac62f

5. https://zhuanlan.zhihu.com/p/41931214

 

2019-04-29 Detailed explanation of supplementary command line parameters: Reprinted from https://zhuanlan.zhihu.com/p/41931214

Basic parameters

  • -CrashReporter: Compile CrashReporter
  • -Clean: Rebuild completely
  • -SignedPak: Use encrypted pak file
  • -SignPak=C:\Encryption.keys or -signpak=0x…..: Specify the encryption pak file key content or key file path, the key content starts with 0x, and the -SignedPak parameter is also effective
  • -RunAssetNativization: Convert blueprint assets into code
  • -Pak: Whether to pack the resource file into the pak, but it does not mean that pak is not used without specifying this command line. Some platforms can only use pak (for example, Android is packaged into an apk). Regardless of whether this parameter is available, see the specific platform pair Overloading Engine\Source\Programs\AutomationTool\AutomationUtils\Platform.csof RequiresPakfunctions in the class
  • -SkipPak: Use the last pak file, including -Pak
  • -UTF8Output: log, console window and other output use UTF8 encoding

Build related parameters

  • -Build: execute the compilation process
  • -SkipBuildClient: do not compile the client
  • -SkipBuildEditor: do not compile the editor
  • -NoXGE: Do not use parallel compilation
  • -ForceDebugInfo: Add debugging information to the non-Debug version

Cook related parameters

  • -Cook: Use Cooked resources
  • -SkipCook: Skip the cook stage, use the last Cook's good resources, and include the -Cook parameter
  • -IgnoreCookErrors: Ignore errors in the cook process
  • -CookFlavor=Multi/ATC/DXT/ETC1/ETC2/PVRTC/ASTC: Specify Android Cook format
  • -CookPartialGC: Insufficient disk space in cook phase, don't clean up all resources
  • -CookInEditor: use editor for cook instead of UAT
  • -CookOutputDir=C:\cooked: Specify the cook result save directory, the default is Project/Saved/Cooked (UAT cook) and Project/Saved/EditorCooked (Editor cook)
  • -AdditionalCookerOptions=xxx: additional command line passed to the cooker process
  • -Compressed: Compressed
  • -EncryptIniFiles: Encrypt ini files, only valid when the encryption key is specified and the pak file is used
  • -EncryptEverything: Encrypt all files, only valid when the encryption key is specified and the pak file is used
  • -EncryptPakIndex: Encrypted pak index, only valid when the encryption key is specified and the pak file is used
  • -UnversionedCookedContent: Does not contain the version number
  • -IterativeCooking(-Iterate): 增量cook
  • -CookAll: all files in the cook content directory
  • -CookMapsOnly: Only cook levels and resources referenced by levels will only take effect when -CookAll is specified at the same time
  • -MapsToCook=map1+map2+map3: Specify the level to be cooked, and connect multiple with + sign
  • -SkipCookingEditorContent: Resources not used by the cook engine editor
  • -NumCookersToSpawn=n: Specify the number of cooker processes
  • -FastCook: Turn on FastCook, if the project supports it

Stage related parameters

  • -Stage: Save intermediate results during the build process
  • -SkipStage: Do not save the intermediate results in the construction process, use the last result, this command line also includes -Stage
  • -StagingDirectory=C:\xxxx: The directory for saving intermediate results during the build process, the default is ProjectPath\Saved\StagedBuilds
  • -NoDebugInfo: Do ​​not copy the debugging information file to the Stage directory, that is, the final package does not contain debugging information
  • -NoCleanStage: The new build will not clean up the files in the previous StagingDirectory, if -clean is specified, it will be cleaned up
  • -StageCommandline=xxxx: A series of command lines placed in UE4CommandLine.txt, the typed package will read the command line from this file and execute it at runtime

Run related parameters

  • -Run: Run the game after the build is complete
  • -CookOnTheFly: Use cooked resources on the server
  • -CookOnTheFlyStreaming: Same as above, but does not cache resources locally
  • -FileServer: Use the resource data cooked on UnrealFileServer
  • -DedicatedServer(-Server): Run the ds server after the build is completed
  • -Client: Use the configuration corresponding to TargetType.Client to run the game
  • -NoClient: Only run the server
  • -LogWindow: Create a log window
  • -Map=xxx: Specify the level at which the game runs
  • -AdditionalServerMapParams=?param=value: Additional parameters of the server map
  • -NumClients=n: the number of clients
  • -AddCmdline=/-ServerCommandline=/-ClientCommandline=xx: additional process parameters

Package related parameters

  • -Package: Execute packaging, Andorid->apk, iOS->ipa
  • -Distribution: The package you hit is the release version, and the Debugable attribute will be disabled on Android and iOS
  • -Prereqs: package dependencies together

Archive related parameters

  • -Archive: Whether to archive the build results to the specified directory
  • -ArchiveDirectory: Archive directory, the default is ProjectPath\ArchivedBuilds
  • -CreateAppBundle: When the target platform is Mac, specify this parameter to archive into an .app file instead of a bunch of bulk files

Deploy related parameters

  • -Deploy: Deploy
  • -DeployFolder: deployment path

 

Avoid link failure, reference 1 original text:

How to package your game with commands

Template:Rating This aims to be a quick guide on how to package and distribute your game.

Some points:

  • If you use unreferenced blueprints/objects, you should add them a) using command line or b) by creating a level with all the objects you need to publish in your game (not recomended)
  • Cooking is the proccess of removing unwanted files from your final build
  • You can choose to Pak (like zip) all your content into a single file
  • If you are building a dedicated server, you need to have the compiled version of Unreal or will not work.
  • You will find the RunUAT at UnrealEngine/Engine/Build/BatchFiles
  • Add the command -build if you're using Source Version from Github
  • If the -allmaps flag is used, [AllMaps] with valid +Map=\Game\Maps\Map.umap syntax should be added to DefaultEditor.ini
  • Specific maps can be built (must remove -allmaps flag) using the -maps=Map1+Map2+Map3

Compiling the client (With PAK files):

RunUAT BuildCookRun -project="full_project_path_and_project_name.uproject" -noP4 -platform=Win64 -clientconfig=Development -serverconfig=Development -cook -allmaps -build -stage -pak -archive -archivedirectory="Output Directory"

Cooking the client (With PAK files):

RunUAT BuildCookRun -project="full_project_path_and_project_name.uproject" -noP4 -platform=Win64 -clientconfig=Development -serverconfig=Development -cook -allmaps -NoCompile -stage -pak -archive -archivedirectory="Output Directory"

Compiling the dedicated server (With PAK files):

RunUAT BuildCookRun -project="full_project_path_and_project_name.uproject" -noP4 -platform=Win64 -clientconfig=Development -serverconfig=Development -cook -server -serverplatform=Win64 -noclient -build -stage -pak -archive -archivedirectory="Output Directory"

Cooking the dedicated server (With PAK files):

RunUAT BuildCookRun -project="full_project_path_and_project_name.uproject" -noP4 -platform=Win64 -clientconfig=Development -serverconfig=Development -cook -server -serverplatform=Win64 -noclient -NoCompile -stage -pak -archive -archivedirectory="Output Directory"

Guess you like

Origin blog.csdn.net/xlyrh/article/details/89553655