開發適用於通用 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 應用程式開發工具,來建立這些通用 Windows 應用程式。Create these Universal Windows apps with Visual Studio and the Universal Windows App development tools.

通用 Windows 平台

在 Windows 10 手機、Windows 10 桌上型電腦或 Xbox 上執行您的應用程式。Run your app on a Windows 10 phone, a Windows 10 desktop, or an Xbox. 全部使用相同的應用程式套件!It's the same app package! 有了 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 手機上按下返回鍵的行為。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. 這個核心 (Core) 包含一個通用來源、一個通用 Windows 核心 (Kernel)、一個檔案 I/O 堆疊,還有一個應用程式模型。There is one common source, one common Windows kernel, one file I/O stack, and one app model. 針對 UI,只有一個 XAML UI 架構和一個 HTML UI 架構。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) Professional Edition (含) 以上版本,並具備支援用戶端 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 裝置以進行開發。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 10 裝置的通用 Windows 平台應用程式。Choose your preferred development language from C#, Visual Basic, C++ or JavaScript to create a Universal Windows Platform app for Windows 10 devices. 請參閱建立您的第一個應用程式,或觀看 Tools for Windows 10 Overview (Windows 10 工具概觀) 影片。Read Create your first app or watch the Tools for Windows 10 Overview video.

如果您已使用 Visual Studio 2015 建立現有的 Windows 市集 8.1 應用程式、Windows Phone 8.1 應用程式或通用 Windows 應用程式,則需要移轉這些應用程式,以使用最新版的通用 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 移至 UWPSee 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.

另請參閱See also