Universal windows platform package logo settings

Universal Windows Platform (UWP) build settings

To create a build for UWP, go to Build Settings (menu: File > Build Settings). In the Platform list, select Universal Windows Platform An 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 HoloLens.
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)
Device Portal Username (optional)
Device Portal Password (optional)

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 Profiler A 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 Build A 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 scripts A 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.

Введение в UWP

Что такое Universal Windows Platform

UWP (Universal Windows Platform) представляет собой унифицированную платформу для создания и запуска приложений в Windows 10 и Windows 10 Mobile.

UWP стала результатом эволюции более ранних технологий. Так, с выходом Windows 8 была внедрена новая архитектурная платформа для приложений — Windows Runtime (WinRT), которая позволяла запускать приложения в так называемом режиме Modern (Metro) на десктопах, планшетах. Затем с выходом Windows 8.1 и Windows Phone 8.1 эта технология получила развитие — появились «универсальные приложения», которые можно было запускать сразу Windows 8.1 и WP8.1. И в июле 2015 года официально вышла новая ОС Windows 10. Она использует платформу UWP, которая представляет собой развитие Windows Runtime.

Как подсказывает название платформы, она является универсальной — универсальной для всех устройств экосистемы Windows 10. А это обычные дестопы, планшеты, мобильные устройства, устройства IoT (интернет вещей), Xbox, устройства Surface Hub. И приложение UWP может одинаково работать на всех этих платформах, если на них установлена Windows 10.

Почему UWP?

Программирование под UWP несет ряд преимуществ:

Широта распространения . На текущий момент (апрель 2017) Windows 10 установлена уже более чем на 400 миллионах устройств. На десктопах Windows 10 уже опередила Windows 8/8.1.

Поддержка широкого круга устройств . Десктопы, планшеты, смартфоны, большие планшеты Surface Hub, различные IoT-устройства, в перспективе устройства виртуальной реальности HoloLens — круг устрйоств, на которых может работать Windows 10 действительно широк.

Поддержка разных языков и технологий программирования . UWP-приложения можно создавать с помощью таких языков, как Visual C++, C#, Visual Basic, JavaScript. В качестве технологии для создания графического интерфейса Visual C++, C# и Visual Basic используют XAML, JavaScript применяет HTML. Кроме того, С++ может вместо XAML использовать DirectX. То есть достаточно распространенные и и знакомые многим технологии.

Магазин приложений и удобство распространения . Windows Store представляет собой прекрасное место для распространения UWP-приложений, как платных, так и бесплатных. Сами возможности платформы и магазина Windows Store позволяют использовать разные способы монетизации. Например, можно интегрировать в приложения блоки для показа рекламы через различные SDK. Можно распространять за определенную плату, причем оплату можно гибко настраивать. При необходимости можно встроить предоставление ознакомительной версии, после использования которой пользователь может решить, покупать приложение или нет. И также можно монетизировать по модели freemium, при которой приложение условно бесплатное, а отдельные услуги внутри приложения предоставляются за определенную плату. Причем все эти возможности монетизации обесечиваются встроенными инструментами SDK.

Богатые возможности платформы . UWP многое наследует от Windows Runtime из Windows 8.1 и в то же время предоставляет много новых функцональностей, как, более богатые возможности по интеграции с облаком, использование Cortana, системы уведомлений в Win10 и многое другое.

Что необходимо для разработки под UWP

Для программирования под UWP необходима ОС Windows 10. Все другие операционные системы, как Windows 8.1/8/7, не говоря уже о Windows XP, не подходят !

Также потребуется среда разработки Visual Studio 2017 Community. Это полнофункциональная бесплатная среда разработки, которую можно загрузить с официального сайта по адресу https://www.visualstudio.com/downloads/download-visual-studio-vs.

Также можно использовать версию VS 2015, а все остальные предыдущие версии Visual Studio — 2013, 2012, 2010 и т.д. с UWP не работают.

При установке Visual Studio 2017 в программе установщика необходимо отметить соответствующий пункт:

Перед чем как начать создание приложений, убедитесь, что в центре обновления в Windows 10 установлена соответствующая опция для разработчиков:

И имея Windows 10 и установленную Visual Studio 2017, можно приступать к разработке приложений.

Разработка приложений для универсальной платформы Windows (UWP) Develop apps for the Universal Windows Platform (UWP)

Благодаря универсальной платформе Windows и единому ядру Windows одно и то же приложение можно запускать на любом устройстве Windows 10 — от телефонов и до настольных компьютеров. With the Universal Windows Platform and our one Windows core, you can run the same app on any Windows 10 device, from phones to desktops. Используйте Visual Studio со средствами разработки универсальных приложений Windows для создания этих приложений. Create these Universal Windows apps with Visual Studio and the Universal Windows App development tools.

Запускайте приложение в Windows 10 Phone, на настольных компьютерах Windows 10 или в Xbox. Run your app on a Windows 10 phone, a Windows 10 desktop, or an Xbox. Это один и тот же пакет приложения! It’s the same app package! С появлением единого унифицированного ядра (OneCore) Windows 10, один пакет приложения может работать на всех платформах. With the introduction of the Windows 10 single, unified core, one app package can run across all platforms. Несколько платформ располагают пакетами SDK расширений, которые можно добавить в приложение для реализации конкретных поведений платформы. Several platforms have extension SDKs that you can add to your app to take advantage of platform-specific behaviors. Например, пакет SDK для расширений для мобильных устройств обрабатывает нажатие кнопки «Назад» в Windows Phone. For example, an extension SDK for mobile handles the back button being pressed on a Windows phone. Если вы ссылаетесь в своем проекте на пакет SDK расширений, просто добавьте проверки времени выполнения, чтобы убедиться, что этот SDK доступен на этой платформе. If you reference an extension SDK in your project, then just add runtime checks to test if that SDK is available on that platform. Таким способом можно иметь один и тот же пакет приложения для каждой платформы! That’s how you can have the same app package for each platform!

Что такое ядро Windows? What is the Windows core?

Для ОС Windows был впервые выполнен рефакторинг, в результате чего было создано общее ядро для всех платформ Windows 10. For the first time, Windows has been refactored to have a common core across all Windows 10 platforms. Это один общий источник, одно общее ядро Windows, один стек ввода-вывода файла и одна модель приложения. There is one common source, one common Windows kernel, one file I/O stack, and one app model. Для пользовательского интерфейса предусмотрена только одна платформа пользовательского интерфейса XAML и одна платформа пользовательского интерфейса HTML. For the UI, there is just one XAML UI framework and one HTML UI framework. Вы можете сосредоточиться на создании превосходных приложений, так как процесс запуска приложений на разных устройствах Windows 10 значительно упрощен. You can concentrate on creating a great app, because we’ve made it easy to have your app run on different Windows 10 devices.

Что такое универсальная платформа Windows? What exactly is the Universal Windows Platform?

Универсальная платформа Windows — это просто коллекция контрактов и версий. The Universal Windows Platform is simply a collection of contracts and versions. Они позволяют нацеливаться на среду, в которой может работать приложение. These allow you to target where your app can run. Вам больше не нужно ориентироваться на операционную систему, теперь вы ориентируетесь на одно или несколько семейств устройств. You no longer target an operating system; now you target one or more device families. Дополнительные сведения см. в разделе Введение в работу с универсальной платформой Windows. Learn more details by reading Intro to the Universal Windows Platform.

Требования Requirements

Средства разработки универсальных приложений Windows поставляются с эмуляторами, которые позволяют узнать, как ваши приложения выглядят на разных устройствах. The Universal Windows App development tools come with emulators that you can use to see how your app looks on different devices. Чтобы использовать эти эмуляторы, необходимо установить соответствующее программное обеспечение на физическом компьютере. If you want to use these emulators, you need to install this software on a physical machine. Физический компьютер должен работать под управлением версии Windows 8.1 Профессиональная (x64) или более поздней и иметь процессор, который поддерживает клиент Hyper-V и преобразование адресов второго уровня (SLAT). The physical machine must run Windows 8.1 (x64) Professional edition or higher, and have a processor that supports Client Hyper-V and Second Level Address Translation (SLAT). Если на виртуальной машине выполнена установка Visual Studio, эмуляторы на ней работать не могут. The emulators cannot be used when Visual Studio is installed on a virtual machine.

Ниже приведен список необходимого программного обеспечения. Here is the list of software that you need:

Windows 10. Windows 10. Visual Studio 2017 поддерживает разработку UWP только в Windows 10. Visual Studio 2017 supports UWP development only on Windows 10. Дополнительные сведения см. в разделах Целевые платформы и Системные требования для Visual Studio. For more details, see Visual Studio Platform targeting and System requirements.

Visual Studio. Visual Studio. Вам также потребуется необязательная рабочая нагрузка «Разработка приложений для универсальной платформы Windows». You will also need the optional Universal Windows Platform development workload.

Windows 10. Windows 10. Visual Studio 2019 поддерживает разработку UWP только в Windows 10. Visual Studio 2019 supports UWP development only on Windows 10. Дополнительные сведения см. в разделах Целевые платформы и Системные требования для Visual Studio. For more details, see Visual Studio Platform targeting and System requirements.

Visual Studio. Visual Studio. Вам также потребуется необязательная рабочая нагрузка «Разработка приложений для универсальной платформы Windows». You will also need the optional Universal Windows Platform development workload.

После установки программного обеспечения нужно разрешить разработку на устройстве Windows 10. After installing this software, you need to enable your Windows 10 device for development. См. раздел Разрешение разработки на устройстве. See Enable your device for development. (Вам больше не нужна лицензия разработчика для каждого устройства Windows 10.) You no longer need a developer license for each Windows 10 device.

Универсальные приложения Windows Universal Windows apps

Выберите предпочтительный язык разработки (C#, Visual Basic, C++ или JavaScript), чтобы создать приложение универсальной платформы Windows для устройств Windows 10. Choose your preferred development language from C#, Visual Basic, C++ or JavaScript to create a Universal Windows Platform app for Windows 10 devices. Ознакомьтесь со статьей о создании первого приложения или видеороликом с обзором инструментов для Windows 10. Read Create your first app or watch the Tools for Windows 10 Overview video.

При наличии существующих приложений Магазина Windows 8.1, приложений для Windows Phone 8.1 или универсальных приложений Windows, созданных с помощью Visual Studio 2015, вам потребуется перенести их, чтобы использовать последнюю версию универсальной платформы Windows. If you have existing Windows Store 8.1 apps, Windows Phone 8.1 apps, or Universal Windows apps that were created with Visual Studio 2015, you’ll need to port these apps to use the latest Universal Windows Platform. См. раздел Перенос приложения из среды выполнения Windows 8.x в UWP. See Move from Windows Runtime 8.x to UWP.

После создания универсального приложения Windows нужно упаковать его, чтобы установить на устройстве Windows 10 или отправить в Магазин Windows. After you create your Universal Windows app, you must package your app to install it on a Windows 10 device or submit it to the Windows Store. См. раздел Упаковка приложений. See Packaging apps.

Читайте также:  Windows failed to start 0xc000000e при загрузочного флешки
Оцените статью
Adblock
detector