2
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

UE4 CommandletをVS上から実行してブレークポイントを使う方法

Posted at

Commandletの実行でブレークポイントを使えないと動作確認が非常に面倒なので調べてみました。

環境

VS2017
UE4.24.3

ソース

一先ずソースは最小構成とします。

TestCommandlet.h
#pragma once
#include "CoreMinimal.h"
#include "Commandlets/Commandlet.h"
#include "TestCommandlet.generated.h"

UCLASS()
class UTestCommandlet : public UCommandlet
{
	GENERATED_UCLASS_BODY()

public:
	UTestCommandlet();
	virtual int32 Main(const FString& CmdLineParams) override;
};
TestCommandlet.cpp
#include "TestCommandlet.h"

UTestCommandlet::UTestCommandlet(const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer)
{
    LogToConsole = false;
}

int32 UTestCommandlet::Main(const FString& CmdLineParams)
{
    return 0;
}

Commandlet用のプロジェクト構成を作成

ss1.png
ss2.png
ss3.png
ss4.png
ss5.png
コマンド引数をCommandletように変更する
ここでは以下とした

"$(SolutionDir)$(ProjectName).uproject" -run=TestCommandlet -stdout -UTF8Output

ss6.png

ブレークポイントを設定して実行

該当箇所にブレークポイントを設定してデバッグ実行を行う
ss7.png

通常のUE4起動に戻すとき

プロジェクトの構成でDebugGame Editorに変更する
ss8.png

2
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?