Hello, Welcome to Microsoft Q&A,
If you are using the Editor, you can uncheck HoloLens 2 in Unreal Engine's Options->Target Platforms, as shown below. If you are using source code to build Unreal Engine, please ask for support from Unreal.
----
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.