Skip to content

Repo sync for protected CLA branch #8429

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 55 commits into from
Sep 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
3b9e73e
Updated as peer User Story: 1955962 Article: 1~
v-niranjan Jun 16, 2022
3a651f3
Updated as peer User Story: 1955962 Article: 1
v-niranjan Jun 16, 2022
cdbb692
Updated as peer User Story: 1955962 Article: 1
v-niranjan Jun 17, 2022
f626d5f
Merge branch 'main' into nr-16jun-vs22-1955962
v-niranjan Jun 17, 2022
710a7f9
Updated as peer User Story: 1955962 Article: 1
v-niranjan Jun 17, 2022
abe3ed9
Updated as per User Story: 1955962
v-niranjan Jun 21, 2022
4e07c77
Updated as per User Story: 1955962
v-niranjan Jun 23, 2022
395e3a4
Updated as per User Story: 1955962
v-niranjan Jun 23, 2022
cf4ffa1
Updated as per User Story: 1955962
v-niranjan Jun 28, 2022
b91052b
Updated as per User Story: 1955962
v-niranjan Jun 28, 2022
e048623
Updated as per User Story:1955~962
v-niranjan Jun 29, 2022
e618253
Updated as per User Story:1955962
v-niranjan Jul 4, 2022
890a9f9
Updated
v-niranjan Jul 12, 2022
5a252e0
Updated as per User Story: 1955962
v-niranjan Jul 27, 2022
ed4b4cd
Updated as per User Story: 1955962
v-niranjan Jul 28, 2022
2254598
Updated as per User Story: 1955962
v-niranjan Aug 2, 2022
56c83e6
Updated as per User Story: 1955962
v-niranjan Aug 2, 2022
5b37c4f
Updated as per User Story: 1955962
v-niranjan Aug 2, 2022
4d87c39
Updated as per User Story: 1955962
v-niranjan Aug 2, 2022
3faaa28
Updated as per User Story: 1955962
v-niranjan Aug 2, 2022
fafb51e
Updated as per Peer Review Feedback
v-niranjan Aug 9, 2022
f00af57
proposed edits-1
ktoliver Aug 12, 2022
6f908e0
proposed-edits-2
ktoliver Aug 12, 2022
084f98b
vs-pluralsight.md #3
ktoliver Aug 13, 2022
5fe08b2
Updated as per Edi~torial Review feedbacks
v-niranjan Aug 17, 2022
eac3032
Updated as per •Technical Review Feedback
v-niranjan Aug 26, 2022
371d5b2
Updating per current community policy
rub8n Aug 26, 2022
0995210
Adds troubleshooting section for GH accounts
rub8n Aug 26, 2022
eab1825
Updated as per •Technical Review Feedback
v-niranjan Aug 26, 2022
6da370a
Updated as per •Technical Review Feedback
v-niranjan Aug 26, 2022
55841d9
Updated as per •Technical Review Feedback
v-niranjan Aug 30, 2022
0f19e54
Merge branch 'main' into nr-16jun-vs22-1955962
v-niranjan Aug 31, 2022
2a1eebb
Updated as per •Technical Review Feedback
v-niranjan Sep 1, 2022
2da700c
Merge branch 'main' into nr-16jun-vs22-1955962
v-niranjan Sep 1, 2022
e994bd3
What's new in docs for August
anandmeg Sep 1, 2022
927e38e
Merge branch 'main' into nr-16jun-vs22-1955962
v-niranjan Sep 2, 2022
23d8ded
Updated as per •Blocking Issue
v-niranjan Sep 2, 2022
372e533
Updated as per •Blocking Issue
v-niranjan Sep 2, 2022
8cab598
Updated as per •Blocking Issue
v-niranjan Sep 2, 2022
2d515ac
Merge pull request #10103 from v-niranjan/nr-16jun-vs22-1955962
Stacyrch140 Sep 2, 2022
7965225
Add manual trigger option
ghogen Sep 2, 2022
221a726
Merge pull request #10378 from MicrosoftDocs/ghogen-patch-25
ghogen Sep 2, 2022
eff6d05
Update docs/ide/work-with-github-accounts.md
rub8n Sep 2, 2022
e6cba0f
Update docs/ide/work-with-github-accounts.md
rub8n Sep 2, 2022
167fe0f
Update docs/ide/work-with-github-accounts.md
rub8n Sep 2, 2022
f71097e
Update docs/ide/work-with-github-accounts.md
rub8n Sep 2, 2022
9ab6afb
Merge pull request #10347 from rub8n/patch-1
prmerger-automator[bot] Sep 2, 2022
e3c93e7
Merge pull request #10346 from rub8n/main
prmerger-automator[bot] Sep 2, 2022
0966325
fixes MicrosoftDocs/visualstudio-docs/issues/8250 -- clarify previous…
WilliamAntonRohm Sep 2, 2022
8dfbc25
fixes MicrosoftDocs/visualstudio-docs/issues/8426 -- note is no longe…
WilliamAntonRohm Sep 2, 2022
f18c285
versioning the note
WilliamAntonRohm Sep 2, 2022
d37938a
Merge pull request #10379 from WilliamAntonRohm/issue-8250-old-link
v-regandowner Sep 2, 2022
b306e02
Merge pull request #10381 from WilliamAntonRohm/issue-8426
prmerger-automator[bot] Sep 2, 2022
5fdf4c2
Merge pull request #10370 from anandmeg/whatsnew-sept
v-regandowner Sep 2, 2022
8ec7300
Merge pull request #10377 from MicrosoftDocs/repo_sync_working_branch
huypub Sep 2, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/stale-issues.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ name: close-stale-issues
on:
schedule:
- cron: "0 0 * * 4"
workflow_dispatch:

permissions:
contents: read
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
title: "Cross-Platform Mobile Development in Visual Studio | Microsoft Docs"
description: In this article, learn how you can build apps for Android, iOS, and Windows devices by using Visual Studio.
titleSuffix: ""
ms.custom: SEO-VS-2020
ms.date: "10/17/2019"
ms.custom: SEO-VS-2020, devdivchpfy22
ms.date: 08/26/2022
ms.technology: vs-ide-mobile
ms.topic: "conceptual"
ms.assetid: 8202717a-e990-45cf-b092-438651ccb38a
author: therealjohn
ms.author: johmil
manager: crdun
ms.workload:
- "multiple"
---

# Cross-platform mobile development in Visual Studio

[!INCLUDE [Visual Studio](~/includes/applies-to-version/vs-windows-only.md)]
Expand All @@ -25,7 +25,7 @@ If you want to build a game or immersive graphical app, install Visual Studio to

## Build an app for Android, iOS, and Windows (.NET Framework)

![Devices](../cross-platform/media/homedevices.png "HomeDevices")
:::image type="content" source="../cross-platform/media/homedevices.png" alt-text="Screenshot showing different types of home devices.":::

With Visual Studio Tools for Xamarin, you can target Android, iOS, and Windows in the same solution, sharing code and even UI.

Expand All @@ -40,25 +40,25 @@ With Visual Studio Tools for Xamarin, you can target Android, iOS, and Windows i

### <a name="AndroidHTML"></a> Target Android, iOS, and Windows from a single code base

You can build native apps for Android, iOS, and Windows by using C# or F# (Visual Basic is not supported at this time). To get started, install Visual Studio, select the **Mobile Development with .NET** option in the installer.
You can build native apps for Android, iOS, and Windows by using C# or F# (Visual Basic isn't supported at this time). To get started, install Visual Studio, select the **Mobile Development with .NET** option in the installer.

If you already have Visual Studio installed, re-run the **Visual Studio Installer** and select the same **Mobile Development with .NET** option for Xamarin (as above).
If you already have Visual Studio installed, rerun the **Visual Studio Installer** and select the same **Mobile Development with .NET** option for Xamarin (as shown earlier).

When you're done, project templates appear in the **New Project** dialog box. The easiest way to find Xamarin templates is to just search on "Xamarin."

Xamarin exposes the native functionality of Android, iOS, and Windows as .NET classes and methods. This means your apps have full access to native APIs and native controls, and they're just as responsive as apps written in the native platform languages.
Xamarin exposes the native functionality of Android, iOS, and Windows as .NET classes and methods. Your apps have full access to native APIs and native controls, and they're as responsive as apps written in the native platform languages.

After you create a project, you'll leverage all of the productivity features of Visual Studio. For example, you'll use a designer to create your pages, and use IntelliSense to explore the native API's of the mobile platforms. When you're ready to run your app and see how it looks, you can use the Android SDK emulator and run Windows apps natively. You can also use tethered Android and Windows devices directly. For iOS projects, connect to a networked Mac and start the iOS emulator from Visual Studio, or connect to a tethered device.
After you create a project, you'll use all of the productivity features of Visual Studio. For example, you'll use a designer to create your pages, and use IntelliSense to explore the native APIs of the mobile platforms. When you're ready to run your app and see how it looks, you can use the Android SDK emulator and run Windows apps natively. You can also use tethered Android and Windows devices directly. For iOS projects, connect to a networked Mac and start the iOS emulator from Visual Studio, or connect to a tethered device.

#### Design one set of pages that render across all devices by using Xamarin.Forms

Depending on the complexity of your apps design, you might consider building it by using *Xamarin.Forms* templates in the **Mobile Apps** group of project templates. Xamarin.Forms is a UI toolkit that lets you create a single interface that you can share across Android, iOS, and Windows. When you compile a Xamarin.Forms solution, you'll get an Android app, an iOS app, and a Windows app. For more details, see [Learn about mobile development with Xamarin](/xamarin/cross-platform/get-started/introduction-to-mobile-development/) and the [Xamarin.Forms documentation](/xamarin/xamarin-forms/).
Depending on the complexity of your apps design, you might consider building it by using *Xamarin.Forms* templates in the **Mobile Apps** group of project templates. Xamarin.Forms is a UI toolkit that lets you create a single interface that you can share across Android, iOS, and Windows. When you compile a Xamarin.Forms solution, you'll get an Android app, an iOS app, and a Windows app. For more information, see [Learn about mobile development with Xamarin](/xamarin/cross-platform/get-started/introduction-to-mobile-development/) and the [Xamarin.Forms documentation](/xamarin/xamarin-forms/).

#### <a name="ShareHTML"></a> Share code between Android, iOS, and Windows apps

If you're not using Xamarin.Forms and choose to design for each platform individually, you can share most of your non-UI code between platform projects (Android, iOS, and Windows). This includes any business logic, cloud integration, database access, or any other code that targets the .NET Framework. The only code that you can't share is code that targets a specific platform.

![Share code between Windows, iOS, and Android UIs](../cross-platform/media/sharecode.png "ShareCode")
:::image type="content" source="../cross-platform/media/sharecode.png" alt-text="Screenshot showing Logical diagram showing share code between Windows, iOS, and Android UIs.":::

You can share your code by using a shared project, a Portable Class Library project, or both. You might find that some code fits best in a shared project, and some code makes more sense inside a Portable Class Library project.

Expand All @@ -69,11 +69,11 @@ With Visual Studio Tools for Xamarin, you can target Android, iOS, and Windows i

### <a name="WindowsHTML"></a> Target Windows 10 devices

![Windows Devices](../cross-platform/media/windowsdevices.png "Windows Devices")
:::image type="content" source="../cross-platform/media/windowsdevices.png" alt-text="Screenshot of different types of Windows devices.":::

If you want to create a single app that targets the full breadth of Windows 10 devices, create a universal Windows app. You'll design the app by using a single project and your pages will render properly no matter what device is used to view them.

Start with a Universal Windows Platform (UWP) app project template. Design your pages visually, and then open them in a preview window to see how they appear for various types of devices. If you don't like how a page appears on a device, you can optimize the page to better fit the screen size, resolution, or various orientations such as landscape or portrait mode. You can do all of that by using intuitive tool windows and easily accessible menu options in Visual Studio. When you're ready to run your app and step through your code, you'll find all of the device emulators and simulators for different types of devices together in one drop-down list that is located on the **Standard** toolbar.
Start with a Universal Windows Platform (UWP) app project template. Design your pages visually, and then open them in a preview window to see how they appear for various types of devices. If you don't like how a page appears on a device, you can optimize the page to better fit the screen size, resolution, or various orientations such as landscape or portrait mode. You can do all of that by using intuitive tool windows and easily accessible menu options in Visual Studio. When you're ready to run your app, and step through your code, you'll find all of the device emulators and simulators for different types of devices together in one drop-down list that is located on the **Standard** toolbar.

|**Learn more**|
|--------------------|
Expand All @@ -85,25 +85,25 @@ With Visual Studio Tools for Xamarin, you can target Android, iOS, and Windows i

## Build an app for Android, iOS, and Windows (C++)

![Use C&#43;&#43; to build for Android, iOS, and Windows](../cross-platform/media/cross_plat_cpp_intro_image.png "Cross_Plat_CPP_Intro_Image")
:::image type="content" source="../cross-platform/media/cross_plat_cpp_intro_image.png" alt-text="Screenshot showing the use C&#43;&#43; to build for Android, iOS, and Windows.":::

First, install Visual Studio and the **Mobile Development with C++** workload. Then, you can build a native activity application for Android, or an app that targets Windows or iOS. You can target Android, iOS, and Windows in the same solution if you want, and then share code between them by using a cross-platform static or dynamic shared library.

If you need to build an app for Android that requires any sort of advanced graphics manipulation, such as a game, you can use C++ to do it. Start with the **Native Activity Application (Android)** project. This project has full support for the Clang toolchain.

![Native activity project template](../cross-platform/media/cross-plat_cpp_native.png "Native activity project template")
:::image type="content" source="../cross-platform/media/cross-plat_cpp_native.png" alt-text="Screenshot showing native activity project template.":::

When you're ready to run your app and see how it looks, use the Android Emulator. It's fast, reliable, and easy to install and configure.

You can also build an app that targets the full breadth of Windows 10 devices by using C++ and a Universal Windows Platform (UWP) app project template. Read more about this in the [Target Windows 10 devices](#WindowsHTML) section that appears earlier in this topic.
You can also build an app that targets the full breadth of Windows 10 devices by using C++ and a Universal Windows Platform (UWP) app project template. Read more about this in the [Target Windows 10 devices](#WindowsHTML) section that appears earlier in this article.

You can share C++ code between Android, iOS, and Windows by creating a static or dynamic shared library.

![Static and dynamic shared libraries](../cross-platform/media/cross_plat_cpp_libraries.png "Static and dynamic shared libraries")
:::image type="content" source="../cross-platform/media/cross_plat_cpp_libraries.png" alt-text="Screenshot showing static and dynamic shared libraries.":::

You can consume that library in a Windows, iOS, or Android project, like the ones described earlier in this section. You can also consume it in an app that you build by using Xamarin, Java, or any language that lets you invoke functions in an unmanaged DLL.
You can consume that library in a Windows, iOS, or Android project, like the ones described earlier in this article. You can also consume it in an app that you build by using Xamarin, Java, or any language that lets you invoke functions in an unmanaged DLL.

As you write code in these libraries, you can use IntelliSense to explore the native APIs of the Android and Windows platforms. These library projects are fully integrated with the Visual Studio debugger so you can set breakpoints, step through code, and find and fix issues by using all of the advanced features of the debugger.
As you write code in these libraries, you can use IntelliSense to explore the native APIs of the Android and Windows platforms. These library projects are fully integrated with the Visual Studio debugger so you can set breakpoints. Step through code, and find and fix issues by using all of the advanced features of the debugger.

|**Learn more**|
|--------------------|
Expand All @@ -120,9 +120,9 @@ With Visual Studio Tools for Xamarin, you can target Android, iOS, and Windows i

Visual Studio Tools for Unity is a free extension for Visual Studio that integrates Visual Studio's powerful code editing, productivity, and debugging tools with *Unity*, the popular cross-platform gaming/graphics engine and development environment for immersive apps that target Windows, iOS, Android, and other platforms including the web.

![VSTU development environment](../cross-platform/media/vstu_overview.png "Visual Studio Tools for Unity overview")
:::image type="content" source="../cross-platform/media/vstu_overview.png" alt-text="Screenshot showing the overview of Visual Studio Tools for Unity and development environment.":::

With Visual Studio Tools for Unity (VSTU), you can use Visual Studio to write game and editor scripts in C# and then use its powerful debugger to find and fix errors. The latest release of VSTU brings support for Unity 2018.1 and includes syntax coloring for Unity's ShaderLab shader language, better synchronization with Unity, richer debugging, and improved code generation for the MonoBehavior wizard. VSTU also brings your Unity project files, console messages, and the ability to start your game into Visual Studio so you can spend less time switching to and from the Unity Editor while writing code.
With Visual Studio Tools for Unity (VSTU), you can use Visual Studio to write game and editor scripts in C# and then use its powerful debugger to find and fix errors. The latest release of VSTU brings support for Unity 2019.4 and includes syntax coloring for Unity's ShaderLab shader language, better synchronization with Unity, richer debugging, and improved code generation for the MonoBehavior wizard. VSTU also brings your Unity project files, console messages, and the ability to start your game into Visual Studio so you can spend less time switching to and from the Unity Editor while writing code.

|**Learn more**|
|--------------------|
Expand Down
Binary file modified docs/cross-platform/media/cross-plat_cpp_native.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/cross-platform/media/cross_plat_cpp_libraries.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/debugger/media/vs-2022/breakpoint-window.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading