Universal Windows Platform
UWP requirements and compatibility
You can use this page to understand key requirements and concepts for Universal Windows Platform (UWP) before starting to develop and build your Unity application.
Topic | Description |
---|---|
UWP requirements and compatibility | Understand the available supported versions and requirements for UWP development in Unity. |
Integrate Unity into UWP applications | Integrate the Unity Runtime Library into UWP applications. |
Universal Windows Platform
UWP requirements and compatibility
Building your application for tvOS
Introduction to Universal Windows Platform
Universal Windows Platform (UWP) provides a common app platform on every device that runs Windows, such as Windows 10+, HoloLens, and more. You can use UWP to build your Unity apps for any Windows device and publish them to the Microsoft Store, without needing to rewrite the app for each platform.
Topic | Description |
---|---|
Introduction to Universal Windows Platform | Understand the key requirements and concepts for UWP. |
Get started with Universal Windows Platform | Learn about UWP-specific settings and how to set up a project for UWP development. |
Develop for Universal Windows Platform | Understand UWP-specific development information, such as deep linking, profilerA window that helps you to optimize your game. It shows how much time is spent in the various areas of your game. For example, it can report the percentage of time spent rendering, animating, or in your game logic. More info See in Glossary connection, and more advanced topics. |
Build and deliver for Universal Windows Platform | Build and deliver your content for UWP. |
Additional resources
- Unity Technologies GitHub: Example UWP Projects
- “Windows Store” platform renamed as “Universal Windows Platform” in Unity 2017.1 NewIn20171
Building your application for tvOS
Introduction to Universal Windows Platform
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
«Unity»、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
Universal Windows Platform: Deployment
Universal Windows Platform: Profiler
To create a build for UWP, go to Build Settings (menu: File > Build Settings). In the Platform list, select Universal Windows PlatformAn IAP feature that supports Microsoft’s In App Purchase simulator, which allows you to test IAP purchase flows on devices before publishing your application. More info
See in Glossary, then select the Switch Platform button.
Note: Universal Windows Platform only shows in the Platform list if you’re using Unity on a Windows computer.
Unity doesn’t support Windows Phone development.
Building UWP applications with Unity
The main workflow when building a game or application for UWP using Unity is as follows:
When you click Build in the Build Settings window:
-
Unity generates and exports a Visual Studio Project.
-
Open the generated Project’s .sln file in Visual Studio.
-
Use Visual Studio to build your final application.
When you click Build And Run, Unity builds an app executable that can run independently.
UWP Build Settings
Use these settings to configure how Unity builds your application.
Setting | Function | |
---|---|---|
Target Device | Choose from the following options to build your app for any device, or select a specific device: Any device, PC, Mobile, or HoloLensAn XR headset for using apps made for the Windows Mixed Reality platform. More info See in Glossary. |
|
Architecture | Select the type of CPU to build for (only applies to Build And Run). | |
x64 | 64-bit CPU. | |
x86 | 32-bit CPU. | |
ARM | 32-bit ARM CPU. | |
ARM64 | 64-bit ARM CPU. | |
Build Type | Select the type of Visual Studio project or build to generate. | |
XAML Project | Visual Studio project that integrates Unity within a full XAML environment. This results in some performance loss, but lets you use XAML elements in your application. | |
D3D Project | Visual Studio project that integrates Unity in a basic app window. This results in the best performance. | |
Executable Only | Hosts the project in a pre-built executable for rapid iteration. This setting has the quickest iteration speed because it doesn’t require you to build the generated project in Visual Studio. It offers the same performance as D3D Project builds. | |
Target SDK Version | The Windows 10 SDK installed on the local PC to build the application against. This setting is only relevant when calling Windows 10 APIs directly from scripts.
Note: Unity requires the base Windows 10 SDK version 10.0.10240.0 or higher for building UWP apps, and doesn’t support Windows 8/8.1 SDKs. |
|
Minimum Platform Version | Minimum Windows 10 release version required to run the app.
Note: This setting is only relevant if you’re using Windows features or APIs that aren’t available in the base Windows 10 version (10.0.10240). |
|
Visual Studio Version | Target a specific Visual Studio release if you have multiple versions installed. | |
Build and Run on | Select the target device or transport to deploy and launch the app during Build And Run. | |
Local Machine | Deploys and launches the app on the local PC. | |
USB Device | Deploys and launches the app on a remote device over a USB connection. | |
Remote Device (via Device Portal) | Deploys and launches the app to a connected device over the Device Portal transport.
To deploy over the Device Portal, you must enter the connection and authentication information in these additional fields: — Device Portal Address (required) For more information, see documentation on Windows Device Portal deployment. |
|
Build Configuration | Select the build type (only applies to Build And Run). Note: These build configurations are the same as those available in the Visual Studio project that Unity generates. |
|
Debug | Produces a build that contains additional code you can use for debugging, and enables the ProfilerA window that helps you to optimize your game. It shows how much time is spent in the various areas of your game. For example, it can report the percentage of time spent rendering, animating or in your game logic. More info See in Glossary for your build. |
|
Release | Produces a build that has debug code stripped out, and enables the Profiler for your build. | |
Master | Produces a build that is fully optimized for release. | |
Copy References | Disable this setting to allow the generated solution to reference Unity files from Unity’s installation folder instead of copying them to the build folder. This can save up to 10 GB of disk space, but you can’t copy the build folder to another PC. Unity also builds your application faster when you disable this setting. | |
Copy PDB files | Enable this setting to include Microsoft program database (PDB) files in the built Standalone Player. PDB files contain debugging information for your application, but might increase the size of your Player. For more information, see documentation on Windows debugging. | |
Development BuildA development build includes debug symbols and enables the Profiler. More info See in Glossary |
A development build includes scripting debug symbols. When you select the Development Build setting, you can also select the Autoconnect Profiler, Script Debugging, and Scripts Only Build setting. It also enables the DEVELOPMENT_BUILD #define.
For more information about #define directives, see documentation on Platform dependent compilation. |
|
Autoconnect Profiler | Automatically connect the Profiler to the build. Only available if you enable the Development Build setting. For more information on the Profiler, see Profiler overview. | |
Deep Profiling | When you enable Deep Profiling, Unity profiles all of your script code and records all function calls. This is useful to pinpoint performance issues with your game code. However, it uses a lot of memory and might not work with very complex scriptsA piece of code that allows you to create your own Components, trigger game events, modify Component properties over time and respond to user input in any way you like. More info See in Glossary. For more information, see documentation on deep profiling. |
|
Script Debugging | Attach script debuggers to the Player remotely. Only available if you enable the Development Build setting. | |
Scripts Only Build | Enable this setting to build just the scripts in the current Project. Only available if you enable the Development Build setting.
Once enabled, Unity only rebuilds the scripts in your application, and leaves data files from a previously executed build intact. It significantly improves iteration times if you only change the code in your application. Note: You need to build the entire Project once before you can use this setting. |
|
Compression Method | Compress the data in your Project at build time. This includes Assets, ScenesA Scene contains the environments and menus of your game. Think of each unique Scene file as a unique level. In each Scene, you place your environments, obstacles, and decorations, essentially designing and building your game in pieces. More info See in Glossary, Player settingsSettings that let you set various player-specific options for the final game built by Unity. More info See in Glossary, and GI data. Choose between the following methods: |
|
Default | Default compressionA method of storing data that reduces the amount of storage space it requires. See Texture Compression, Animation Compression, Audio Compression, Build Compression. See in Glossary is set to None. |
|
LZ4 | A fast compression format that is useful for development builds. LZ4 compression can significantly improve loading time of applications built with Unity. For more information, see BuildOptions.CompressWithLz4. | |
LZ4HC | LZ4HC — A high compression variant of LZ4 that is slower to build but produces better results for release builds. LZ4HC compression can significantly improve loading time of applications built with Unity. For more information, see BuildOptions.CompressWithLz4HC. |
Did you find this page useful? Please give it a rating:
Universal Windows Platform: Deployment
Universal Windows Platform: Profiler
Чтобы создать сборку для UWP, перейдите в раздел Настройки сборки (меню: Файл > Настройки сборки). В списке Платформа выберите Универсальная платформа WindowsФункция IAP, которая поддерживает симулятор Microsoft In App Purchase, который позволяет протестировать потоки покупок IAP на устройствах перед публикацией приложения. Дополнительная информация
См. Словарь, затем выберите Переключить платформу кнопка.
Примечание. Универсальная платформа Windows отображается в списке Платформа, только если вы используете Unity на компьютере с Windows.
Unity не поддерживает разработку для Windows Phone.
Создание приложений UWP с помощью Unity
Основной рабочий процесс при создании игры или приложения для UWP с помощью Unity выглядит следующим образом:
Когда вы нажимаете Построить в окне Настройки сборки:
-
Unity создает и экспортирует проект Visual Studio.
-
Откройте файл .sln сгенерированного проекта в Visual Studio.
-
Используйте Visual Studio для создания окончательного приложения.
Когда вы нажимаете Сборка и запуск, Unity создает исполняемый файл приложения, который может работать независимо.
Настройки сборки UWP
Используйте эти параметры для настройки того, как Unity создает ваше приложение.
Настройки | Функции | |
---|---|---|
Target Device | Выберите один из следующих вариантов, чтобы создать приложение для любого устройства, или выберите конкретное устройство: Любое устройство, ПК, Мобильное или HoloLens. | |
Architecture | Выберите тип процессора для сборки (применимо только к Build And Run). | |
x64 | 64-bit CPU. | |
x86 | 32-bit CPU. | |
ARM | 32-bit ARM CPU. | |
ARM64 | 64-bit ARM CPU. | |
Build Type | Выберите тип проекта или сборки Visual Studio для создания. | |
XAML Project | Проект Visual Studio, который интегрирует Unity в полную среду XAML. Это приводит к некоторой потере производительности, но позволяет использовать элементы XAML в приложении. | |
D3D Project | Проект Visual Studio, который интегрирует Unity в базовое окно приложения. Это приводит к лучшей производительности. | |
Executable Only | Размещает проект в предварительно созданном исполняемом файле для быстрой итерации. Этот параметр имеет наибольшую скорость итерации, поскольку не требует сборки сгенерированного проекта в Visual Studio. Он предлагает ту же производительность, что и сборки D3D Project. | |
Target SDK Version | Windows 10 SDK, установленный на локальном ПК для сборки приложения. Этот параметр имеет значение только при вызове API-интерфейсов Windows 10 непосредственно из скриптов.
Примечание. Unity требует базовой версии Windows 10 SDK 10.0.10240.0 или выше для создания приложений UWP и не поддерживает Windows 8/8.1 SDK. |
|
Minimum Platform Version | Минимальная версия выпуска Windows 10, необходимая для запуска приложения.
Примечание. Этот параметр имеет значение только в том случае, если вы используете функции или API Windows, недоступные в базовой версии Windows 10 (10.0.10240). |
|
Visual Studio Version | Ориентируйтесь на конкретный выпуск Visual Studio, если у вас установлено несколько версий.. | |
Build and Run on | Выберите целевое устройство или транспорт для развертывания и запуска приложения во время Build And Run.. | |
Local Machine | Развертывает и запускает приложение на локальном ПК. | |
Remote Device (via Device Portal) | Развертывает и запускает приложение на подключенном устройстве через транспорт портала устройств.
Для развертывания через портал устройств необходимо ввести информацию о соединении и аутентификации в следующих дополнительных полях: – Адрес портала устройств (обязательно) Дополнительную информацию см. в документации по развертыванию портала устройств Windows. |
|
Build Configuration | Выберите тип сборки (применимо только к Build And Run). Примечание. Эти конфигурации сборки такие же, как и доступные в проекте Visual Studio, который генерирует Unity. |
|
Debug | Создает сборку, содержащую дополнительный код, который можно использовать для отладки, и открывает окно Profiler, помогающее оптимизировать игру. Он показывает, сколько времени вы тратите на различные области вашей игры. Например, он может сообщать о проценте времени, затраченном на рендеринг, анимацию или игровую логику. Дополнительная информация См. в Словарь свою сборку. |
|
Release | Создает сборку, в которой удален код отладки, и включает Profiler для вашей сборки. | |
Master | Создает сборку, полностью оптимизированную для выпуска. | |
Copy References | Отключите этот параметр, чтобы сгенерированное решение могло ссылаться на файлы Unity из папки установки Unity, а не копировать их в папку сборки. Это может сэкономить до 10 ГБ дискового пространства, но вы не сможете скопировать папку сборки на другой компьютер. Unity также быстрее создает ваше приложение, если вы отключите этот параметр.. | |
Copy PDB files | Включите этот параметр, чтобы включить файлы базы данных программы Microsoft (PDB) во встроенный автономный проигрыватель. Файлы PDB содержат отладочную информацию для вашего приложения, но могут увеличить размер вашего проигрывателя. Дополнительные сведения см. в документации по отладке Windows. | |
Development BuildСборка разработки включает символы отладки и включает профилировщик. Подробнее См. в Словарь |
Сборка для разработки включает символы отладки сценариев. При выборе параметра Сборка для разработки также можно выбрать параметры Профилировщик автоподключения, Отладка скриптов и Сборка только скриптов настройка. Это также включает DEVELOPMENT_BUILD #define.
Дополнительную информацию о директивах #define см. в документации по платформенно-зависимой компиляции. |
|
Autoconnect Profiler | Автоматически подключать Profiler к сборке. Доступно только при включении параметра Разработка. Дополнительную информацию о Profiler см. в обзоре Profiler. | |
Deep Profiling | Когда вы включаете Глубокое профилирование, Unity профилирует весь код вашего скрипта и записывает все вызовы функций. Это полезно для выявления проблем с производительностью кода вашей игры. Однако он использует много памяти и может не работать с очень сложными скриптамифрагмент кода, позволяющий создавать собственные Компоненты, запускайте игровые события, изменяйте свойства Компонентов с течением времени и реагируйте на ввод данных пользователем любым удобным для вас способом. Подробнее См. в Словарь. Дополнительные сведения см. в документации по глубокому профилированию.. |
|
Script Debugging | Удаленно подключайте отладчики скриптов к проигрывателю. Доступно только при включении параметра Разработка. | |
Scripts Only Build | Включите этот параметр, чтобы создавать только сценарии в текущем проекте. Доступно только при включении параметра Разработка.
После включения Unity только перестраивает скрипты в вашем приложении и оставляет файлы данных из ранее выполненной сборки нетронутыми. Это значительно сокращает время итерации, если вы изменяете только код в своем приложении. Примечание. Прежде чем использовать этот параметр, необходимо один раз собрать весь проект. |
|
Compression Method | Сжимайте данные в своем проекте во время сборки. Сюда входят ресурсы, сценыСцена содержит окружение и меню вашей игры. Думайте о каждом уникальном файле сцены как об уникальном уровне. В каждой сцене вы размещаете свое окружение, препятствия и декорации, по сути проектируя и создавая свою игру по частям. Подробнее См. в Словарь, Настройки игрокаНастройки, которые позволяют вам установить различные параметры игрока для окончательной игры, созданной Unity. Подробнее См. в Словарь и данные GI. Выберите один из следующих методов: |
|
Default | сжатие по умолчаниюМетод хранения данных, уменьшающий объем требуемого дискового пространства. См. Сжатие текстур, Сжатие анимации, Сжатие звука, Сжатие компоновки. Для параметра См. в Словарь установлено значение Нет. |
|
LZ4 | Формат быстрого сжатия, полезный для сборок разработки. Сжатие LZ4 может значительно сократить время загрузки приложений, созданных с помощью Unity. Дополнительные сведения см. в разделе BuildOptions.CompressWithLz4. | |
LZ4HC | LZ4HC — вариант LZ4 с высокой степенью сжатия, сборка которого выполняется медленнее, но дает лучшие результаты при выпуске сборок. Сжатие LZ4HC может значительно сократить время загрузки приложений, созданных с помощью Unity. Дополнительные сведения см. в разделе BuildOptions.CompressWithLz4HC. |
To package a Universal Windows Platform (UWP) app in Visual Studio, follow these steps:
-
Open the built UWP project in Visual Studio. In the Solution Explorer, right-click on your main project and go to Publish > Create App Packages.
-
Select Microsoft Store using a new app name and click Next.
-
Sign in to the Partner Center with your developer account.
-
Use the following steps to deploy your UWP application:
-
Choose the deployment target from the dropdown list next to the “Project” → “Store” → “Create App Packages” menu.
-
Add dependencies to your UWP app by placing them in your Unity Assets folder under a Plugins folder.
-
Try performing a clean build of the UWP project (from Unity) to a new/different output folder and see if that fixes the problem.
To create a UWP app that can be uploaded to the Windows Store, you need to open build settings in Unity, build to your desired location locally, and add dependencies to DLLs and WINMDs. Make sure to check UWP Requirements and compatibility before getting started.
In summary, to package a UWP app in Visual Studio, follow these steps:
-
Right-click on your main project and go to Publish > Create App Packages.
-
Select Microsoft Store using a new app name and click Next.
-
Sign in to the Partner Center with your developer account.
-
Use the following steps to create an AppX package from your UWP project:
-
Add dependencies to your UWP app by placing them in your Unity Assets folder under a Plugins folder.
-
Perform a clean build of the UWP project to a new/different output folder.
📹 Publish Unity Universal Windows Platform Build to Microsoft Store
A Quick Review of How I built a UWP Package from my Unity Game and Uploaded it to the Microsoft Store! Leave a comment if …
How do I package my UWP app?
To create an app package for a Microsoft Store application, open your UWP project in Visual Studio and navigate to the Publish Create App Packages wizard. Select Microsoft Store using a new app name and click Next. If Sideloading is selected, Visual Studio will not generate the app package upload file for Partner Center submissions. Sign in to the Partner Center with your developer account or reserve a new name in the Partner Center.
Select the architectures you want to target based on the devices you want to deploy your application to in the Select and Configure Packages dialog. In the Generate app bundle listbox, select Always and click Create to generate the app package.
To install the package on your machine, open the folder containing the package and right-click on the Add-AppxPackage. appx file. Choose Run with PowerShell and follow the prompts. If you’re re-installing an. appx file, uninstall the previously installed file by right-clicking the file icon and clicking Uninstall.
How to install a package Unity?
In order to import Google packages for Unity, it is necessary to select the “Assets” option, followed by “Import package” and then “Custom Package.” All items should then be imported. Google packages for Unity are distributed in two formats: a Unitypackage, which can be imported in Unity 5 and above, and a tgz, which can be imported in Unity 2018. Versions 4 and above include dependent packages that must be installed separately.
What is UWP in Unity?
The Universal Windows Platform (UWP) is a unified application platform for Windows devices, including those running Windows 10 and the HoloLens headset. It enables Unity developers to create apps for any Windows device and publish them to the Microsoft Store without having to rewrite the app for each platform. In Unity 2017, the platform was renamed the “Universal Windows Platform.”
How to install universal windows platform in Unity?
In order to create a build for UWP, it is necessary to navigate to Build Settings and select the Universal Windows Platform. The “Switch Platform” button is only accessible when Unity is utilized on a Windows computer. The principal workflow for the construction of UWP applications via Unity entails the generation and exportation of a Visual Studio project.
To create an app package for a Microsoft Store application, open your UWP project in Visual Studio and navigate to the Publish Create App Packages wizard. Select Microsoft Store using a new app name and click Next. If Sideloading is selected, Visual Studio will not generate the app package upload file for Partner Center submissions. Sign in to the Partner Center with your developer account or reserve a new name in the Partner Center.
Select the architectures you want to target based on the devices you want to deploy your application to in the Select and Configure Packages dialog. In the Generate app bundle listbox, select Always and click Create to generate the app package.
To install the package on your machine, open the folder containing the package and right-click on the Add-AppxPackage. appx file. Choose Run with PowerShell and follow the prompts. If you’re re-installing an. appx file, uninstall the previously installed file by right-clicking the file icon and clicking Uninstall.
Is Microsoft abandoning UWP?
Microsoft has announced that UWP will only receive bug, reliability, and security fixes, not new features, indicating that it is now deprecated. Developers who are satisfied with UWP’s current functionality can continue using it. However, those who want the latest runtime, language, and platform features, including WinUI 3, WebView 2,. NET 5, full compatibility with Windows 10 version 1809 or newer, and any upcoming new features will have to migrate their apps to the Windows App SDK.
This announcement represents an official step towards the future of Windows app development, which is desktop apps built with the Windows App SDK, not UWP. Developers who have invested time in learning UWP and creating UWP apps can apply their knowledge and experience to create new Windows App SDK apps or migrate existing apps to this improved and fully supported platform. This is one of Microsoft’s greatest strengths as a platform maker, as it continues to prioritize not leaving developers behind.
Is UWP outdated?
Microsoft has announced that UWP will only receive bug, reliability, and security fixes, not new features, indicating that it is now deprecated. Developers who are satisfied with UWP’s current functionality can continue using it. However, those who want the latest runtime, language, and platform features, including WinUI 3, WebView 2,. NET 5, full compatibility with Windows 10 version 1809 or newer, and any upcoming new features will have to migrate their apps to the Windows App SDK.
This announcement represents an official step towards the future of Windows app development, which is desktop apps built with the Windows App SDK, not UWP. Developers who have invested time in learning UWP and creating UWP apps can apply their knowledge and experience to create new Windows App SDK apps or migrate existing apps to this improved and fully supported platform. This is one of Microsoft’s greatest strengths as a platform maker, as it continues to prioritize not leaving developers behind.
How do I make a Windows build in Unity?
To create a build for Windows, navigate to Build Settings and select Windows from the Platform list. Then, select Switch Platform and configure Unity’s build process. Asset Import Overrides can be used to locally override all texture import settings, enhancing import and platform switch time. This setting is recommended to avoid shipping the final build with any import overrides, but can be used during development to speed up iteration time, especially if assets like low resolution textures are not a concern.
How do I run a UWP executable?
UWP apps cannot be launched directly from an exe file as they are running in a sandbox and cannot be directly run like desktop apps. Instead, they should be launched from the Start Menu after installation. If you have any further questions, please click “Comment” and follow the steps in the documentation to enable email notifications. If you want to receive related email notifications, please follow the provided steps.
How do I distribute my UWP app without the store?
To distribute an application to other devices without placing it in the Store, you need to obtain a certificate, sign it using it, and sideload it onto those devices. You can create a certificate or obtain one from a popular vendor like Verisign. If you plan to distribute your application on Windows 10 S or Windows 11 S devices, you must go through the Store submission process. If you create a certificate, install it in the Trusted Root or Trusted People certificate store on each device running your app.
How do I deploy UWP apps?
To deploy an app in Visual Studio, select the debug target drop-down next to the Start Debugging button and choose the target you want to deploy your app to. You can start debugging by pressing F5 or Ctrl+F5 to deploy to that target. The app can be deployed to a simulated environment on your current development machine, local machine, remote machine, device, or an emulator target. Simulator will deploy the app to a simulated environment on your current development machine, while local machine will deploy the app to your current machine.
Remote machine allows you to specify a remote target, while device will deploy the app to a USB-connected device, which must be developer unlocked and have the screen unlocked. Emulators are only available on Hyper-V enabled machines running Windows 8. 1 or beyond. Visual Studio can also attach to any running UWP app process by selecting Debug and then Attach to Process.
📹 Unity How To Publish Game/App to Microsoft Windows Store UWP Project Visual Studio (Part 1)
1.Open .sln file (i used Visual studio 2019= 2.Visual assets choose 400×400 PNG icon with low size 3. Top of file choose Master …