Play Testing and Packaging
Play test in every Play In Editor mode, then package, cook and Quick Launch your Unreal Engine project from your AI assistant, on UE 5.6, 5.7 and 5.8.
Play test in every Play In Editor mode, then package, cook and Quick Launch your Unreal Engine project from your AI assistant, on UE 5.6, 5.7 and 5.8.
CodeFizz Editor Agent can drive the toolbar's Play menu and the Platforms menu. Your AI assistant can play test your game in every Play mode, with any net mode and number of players, then package it, cook it, or launch it on a device. Each command runs the editor's own code, so you get what clicking the menu gives you: the same packaging notification with its Cancel button, and the same lines in the Output Log.
It needs plugin 2.4.0 and cfa 3.5.0 or later, and it works on Unreal Engine 5.6, 5.7 and 5.8. The editor must be open with your project.
1. Play with a listen server and one client, each in its own window:
cfa play_in_editor --mode new_window --net-mode listen_server --num-players 22. Check that a Shipping package for Windows will work:
cfa validate_packaging --platform Windows --configuration Shipping3. Package it, then watch the job:
cfa package_project --platform Windows --configuration Shipping --archive-directory D:/Builds
cfa get_build_statusplay_in_editor runs the toolbar's own Play commands. With no flags it repeats the last mode, like the green Play button. --mode picks one of the six modes of the Play menu:
viewport Selected Viewport
new_window New Editor Window
vr VR Preview (needs a headset)
mobile Standalone Game Mobile
standalone Standalone Game
simulate SimulateThe green Play button, the last mode again:
cfa play_in_editorPlay in the level viewport and start at the Player Start:
cfa play_in_editor --mode viewport --spawn-at player_startA listen server and two clients:
cfa play_in_editor --mode new_window --net-mode listen_server --num-players 3Simulate:
cfa play_in_editor --mode simulate--spawn-at, --net-mode and --num-players set the same values as the Play menu's own controls. Like those controls, they are saved in Editor Preferences and stay for the next Play. The reply lists every change in settings_changed with its old and new value, so you can put your own values back.
With listen_server, the first player is the server and has a window. With client, the editor adds a dedicated server with no window, and every player is a client. You can have 1 to 10 players on UE 5.8, and up to 64 on 5.6 and 5.7. The command waits until play has started and every client has joined, then returns the session:
{
"state": "playing",
"worlds": [
{
"instance": 0,
"net_mode": "listen_server",
"players": 2,
"map": "/Game/ThirdPerson/Lvl_ThirdPerson",
"shown_in": "MyGame Preview [NetMode: Server 0] (64-bit/PC D3D SM6)"
},
{
"instance": 1,
"net_mode": "client",
"players": 1,
"map": "/Game/ThirdPerson/Lvl_ThirdPerson",
"shown_in": "MyGame Preview [NetMode: Client 1] (64-bit/PC D3D SM6)"
}
]
}shown_in is level_viewport or the title of the window. Give that title to cfa take_screenshot --window to take a picture of one window.
--save-dirty=true to save them first), and it refuses a level that was never saved. While a Standalone Game runs, a new play_in_editor is refused, because starting play would close it.See every world with its net mode, players, map and window:
cfa get_play_sessionPause, step one frame, then resume:
cfa control_play_session --action pause
cfa control_play_session --action advance_frame
cfa control_play_session --action resumeLeave the player and fly freely (F8), then take the player back:
cfa control_play_session --action eject
cfa control_play_session --action possessStop play. This also closes Standalone Game windows:
cfa stop_play_in_editorEject and possess work only for a session in the level viewport, as in the editor. The command waits for the switch, so the reply already shows the new state. Every other Play setting, such as Run Under One Process, the window size or the server port, is in cfa get_project_settings --class-name LevelEditorPlaySettings.
A package can take an hour, so check first. validate_packaging reads the same settings the package will use. It returns a verdict (pass, pass with warnings or fail) and a list of what to fix.
The platforms you can package for, with their SDK state and build targets:
cfa list_platforms --supported-only=trueWill a Shipping package for Windows work?
cfa validate_packaging --platform Windows --configuration Shipping{
"verdict": "pass",
"errors": 0,
"warnings": 0,
"platform": "Windows",
"configuration": "Shipping",
"target": "MyGame (Game)",
"findings": [
{ "code": "sdk", "severity": "info", "message": "SDK installed.", "target": "Windows" }
]
}If the engine install does not have the files for a platform, packaging for it is refused, as the editor refuses it, and the check reports a fail.
package_project builds the same BuildCookRun command as Platforms > Package Project. It uses the same settings: Project Settings > Packaging, plus the platform, target and configuration you give. It saves unsaved assets first, as the menu does.
Nothing starts. The reply shows the full command line that the package will run.
cfa package_project --platform Windows --configuration Shipping --dry-run=trueThe command returns at once with a job_id. The editor shows its "Packaging project for Windows..." notification with a Cancel button, and every line goes to the Output Log.
cfa package_project --platform Windows --configuration Shipping --archive-directory D:/BuildsThe build lands in a platform folder inside the archive folder, for example D:/Builds/Windows/.
Cook the content only:
cfa cook_content --platform WindowsRead the Packaging settings the package uses:
cfa get_project_settings --class-name ProjectPackagingSettingsChange one of them, for example For Distribution:
cfa set_project_settings --class-name ProjectPackagingSettings --property-name ForDistribution --property-value trueThe configurations are project (the one in the Packaging settings), DebugGame, Development, Test and Shipping. With For Distribution on, the package is always Shipping.
The stage, the errors and the newest lines of the log:
cfa get_build_statusOnly the errors, up to 50 lines:
cfa get_build_status --severity error --max-lines 50Stop the job:
cfa cancel_build{
"job_id": 1,
"kind": "package",
"platform": "Windows",
"state": "succeeded",
"stage": "Archive",
"stages_done": ["Cook", "Stage", "Package", "Archive"],
"errors": 0,
"warnings": 5,
"verdict": "pass_with_warnings",
"output_directory": "D:/Builds",
"log_file": "C:/MyGame/Saved/CodeFizzEditorAgent/Builds/package_1_20261020-074039.log",
"lines": [
"BUILD SUCCESSFUL",
"AutomationTool exiting with ExitCode=0 (Success)"
]
}The stages are build, cook, stage, package and archive, and the whole log is in log_file. One job runs at a time, because every packaging run in the editor shares one queue. A second start is refused and names the job that runs. A job stays queued while the editor's own SDK check holds that queue.
Quick Launch builds, cooks, deploys and runs the current level on a device, with the editor's own launcher and notifications. You watch and cancel it with the same two commands as a package.
Find the device:
cfa list_devicesLaunch the current level on it:
cfa quick_launch --device Windows@MYPCA launch that runs the game stays running until the game exits. To close the game, find its process and end it. The process name is your project name, or UnrealGame for a project with no C++ code.
Find the game process, then end it:
cfa list_device_processes --device Windows@MYPC --filter MyGame
cfa control_device --device Windows@MYPC --action terminate_process --process-id <pid> --confirm=trueA profile is a saved launch: the project, build target, platform, configuration, content scheme, cook, archive, devices, start map and extra command line. Only the fields you give change, and the reply reads every field back from the saved profile.
This one makes a Shipping build for Windows and keeps a copy in D:/Builds.
cfa create_launch_profile --name "Win Shipping" --platform Windows --configuration Shipping --content-scheme pak_files --deploy=false --archive=true --archive-directory D:/BuildsThe verdict says what to fix before you launch.
cfa validate_launch_profile --profile "Win Shipping"It returns a job id. Watch it with get_build_status and stop it with cancel_build.
cfa run_launch_profile --profile "Win Shipping"List, rename and delete profiles:
cfa list_launch_profiles
cfa set_launch_profile --profile "Win Shipping" --new-name "Win Shipping Archive"
cfa delete_launch_profile --profile "Win Shipping Archive"Open the Project Launcher window itself:
cfa open_tab --tab-id ProjectLauncherThe engine keeps a copy of the build only when the profile does not deploy, so use --archive=true with --deploy=false. If not, the check warns that the archive is skipped. The start map is saved by name, and a name that several maps share gives a warning. Profiles are saved per engine install, not per project, so the list can show profiles of your other projects.
Every device with its status:
cfa list_devicesThe processes that run on a device:
cfa list_device_processes --device Windows@MYPC --filter UnrealClaim, release or share a device:
cfa control_device --device Windows@MYPC --action releaseOpen the Device Manager window itself:
cfa open_tab --tab-id DeviceManagerThe editor claims this computer as a device when it starts. On it, power_off and reboot turn off or restart this computer, so they need --confirm=true. Ending a process also needs --confirm=true, and the editor's own process is always refused.
You do not have to type any of this. The skill that ships with the CLI teaches your assistant the same steps. You can ask in plain words:
Play the level with a listen server and two clients, take a screenshot of each window, then stop.
Check that a Shipping build for Windows will package, tell me what to fix, then package it to D:/Builds.
Cook the content for Windows and list every error.
Make a Project Launcher profile that keeps a Shipping build in D:/Builds, check it, and run it.If your assistant does not know these commands yet, update its skill with cfa skill install. See The AI Skill.
Play did not start (state is idle)
Read why with cfa read_message_log --log-name PIE.
Standalone Game or Quick Launch refuses because assets are unsaved
Add --save-dirty=true, or save first with cfa save_all. A level that was never saved needs cfa save_level_as.
A job is already running
Only one job runs at a time. Wait for it with cfa get_build_status, or stop it with cfa cancel_build.
The engine install lacks the files for a platform
Add that platform to your engine install, or package for another platform. cfa list_platforms marks such a platform with installed_files_missing.
Play, see the session, control it, stop it:
cfa play_in_editor --mode <mode>
cfa get_play_session
cfa control_play_session --action <action>
cfa stop_play_in_editorCheck, package, cook:
cfa list_platforms
cfa validate_packaging --platform <name>
cfa package_project --platform <name>
cfa cook_content --platform <name>Watch or stop any job:
cfa get_build_status
cfa cancel_buildLaunch the current level on a device:
cfa quick_launch --device <id>Project Launcher profiles:
cfa list_launch_profiles
cfa create_launch_profile --name "<name>"
cfa validate_launch_profile --profile "<name>"
cfa run_launch_profile --profile "<name>"Devices:
cfa list_devices
cfa list_device_processes --device <id>
cfa control_device --device <id> --action <action>Every flag of the packaging and device commands is in the Packaging and Devices reference. The Play commands are on the Level Actors reference page.