[UE5.0]How to enable console command in shipping build?

I tried to enable console command City Sample’s “shipping” build, but nothing to do with

-Add “ALLOW_CONSOLE_IN_SHIPPING=1” in Build.h
-Add PublicDefinitions.Add(“ALLOW_CONSOLE_IN_SHIPPING=1”); in CitySample.Build.cs

Also cant select “test” build with this project. Anyway to enable console command?

3 Likes

I think you’ll find console commands work in a UE5 shipping build at the moment, unless you build with the launcher.

3 Likes

I Package for Windows and it just works. I didn’t do anything special. This is using 4.27.2.

You have to use engine build from source code via Github, not from the Epic launcher.

The engine from Epic launcher can not make “Test” Build Package.
“Test” Build could be made from an engine built from source code only.

And for logging in shipping build, what you did in the build configuration file is not enough.
In addition to that, you have to modify Build.h in source of engine, like this : How to log in shipping build (Win)? - #26 by anonymous_user_8b5b74cb
(#define USE_LOGGING_IN_SHIPPING 0 → #define USE_LOGGING_IN_SHIPPING 1 )

1 Like

Thank you for info. I tried to build from source UE5 but City Sample project always requires convert process even UE5 build by VS2019 or 2022. And this causes so much long time for compiling and optimizing every files I opened so I gave up. Anyway thanks for helps.

1 Like

As a workaround you can use widget in shipping build. Pass your command through widget and then execute it inside by ExecuteConsoleCommand
image

2 Likes

Hi, I was trying to work on my game and was wondering, would the “execute console command” node work in a shipping build? Like, its working in standalone as well as a development build, but I am not sure if this works in a shipping build

1 Like

Hey, It will. As I mentioned before you can create a widget and pass the text from to function

1 Like