> For the complete documentation index, see [llms.txt](https://dilly.gitbook.io/dilly/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dilly.gitbook.io/dilly/enabling-console-in-shipping-builds.md).

# Enabling console in shipping builds

You can enable the console in shipping builds by doing the following:

```
#include "Engine/Console.h"

void AMyPlayerController::EnableConsoleInPackaged()
{
    UGameViewportClient* Viewport = GetWorld()->GetGameViewport();
    if(Viewport->ViewportConsole == nullptr)
    {
       Viewport->ViewportConsole = NewObject<UConsole>(Viewport, GEngine->ConsoleClass);
    }
}
```

The example function is run in a player controller on begin play.
