[Win 10] How to Installing .appx file in Windows 10 devices
Introduction:
In prev post i was explained about how to deploy .appx file in WinRT windows phone. During development you typically deploy and run your app from Visual Studio. Optionally in WinRT/Silverlight windows phone, you can also use the stand-alone Application Deployment tool to deploy your app to the emulator or to a registered device. But in Windows 10 Universal Windows Platform(UWP), With Windows 10 SDK Preview Build 10166, Microsoft was introduce the Windows 10 Application Deployment (WinAppDeployCmd.exe) tool.
You can also read this article from my original blog.
The Windows 10 Application Deployment (WinAppDeployCmd) is a command line utility that can be utilized to deploy a Universal Windows app from a Windows 10 PC to any Windows 10 mobile device. It allows users to deploy an .AppX to a device connected through USB or available on the same subnet without requiring access to the complete Visual Studio solution.
From : https://code.msdn.microsoft.com/windowsapps/UWP-Apps-How-to-instal-d20eb116#content
In prev post i was explained about how to deploy .appx file in WinRT windows phone. During development you typically deploy and run your app from Visual Studio. Optionally in WinRT/Silverlight windows phone, you can also use the stand-alone Application Deployment tool to deploy your app to the emulator or to a registered device. But in Windows 10 Universal Windows Platform(UWP), With Windows 10 SDK Preview Build 10166, Microsoft was introduce the Windows 10 Application Deployment (WinAppDeployCmd.exe) tool.
You can also read this article from my original blog.
The Windows 10 Application Deployment (WinAppDeployCmd) is a command line utility that can be utilized to deploy a Universal Windows app from a Windows 10 PC to any Windows 10 mobile device. It allows users to deploy an .AppX to a device connected through USB or available on the same subnet without requiring access to the complete Visual Studio solution.
Requirements:
Description:
This article can explain you about below topics
1. Why .Appx Deployment?
2. What are prerequisites to deploy .AppX file?
3. How to use Application Deployment (WinAppDeployCmd.exe) tool?
1. Why .AppX Deployment?
Often when you write a Windows Phone application you do not want to give users the full source code. In such cases it is possible to share only the build file and deploy it to a device or emulator. You can accomplish this using the Windows Phone Application Deployment tool that comes with the RTM version of Windows Phone Developer Tools.
2. What are prerequisites to deploy .AppX file?
WinAppDeployCmd is a stand-alone tool that comes as part of the Windows 10 SDK installation. To use it we need to follow below steps.
Go into the Settings of a Windows 10 phone device and search for Update & Security category and turn on Developer Mode.
In this article, we selected the 'ARM' platform and now press the “Create” button. Then wizard gives us a link to where the package was created.
So now you can get the path where .AppX has been created like below:
Please copy above .Appx file path, which we need to use it in deployment.
Now we can found installed app on device/emulator like below:
- This article is targeted for windows 10 Universal Windows Platform(#UWP) , so make sure you’ve downloaded and installed the latest Windows 10 SDK from here.
- I assumes that you’re going to test your app on the Windows Phone emulator. If you want to test your app on a phone, you have to take some additional steps. For more info, see Register your Windows Phone device for development.
- This post assumes you’re using Microsoft Visual Studio 2015 or Later.
- This article is developed on windows 8.1 machine. So Visual Studio settings may differ from windows 10 OS VS.
Description:
This article can explain you about below topics
1. Why .Appx Deployment?
2. What are prerequisites to deploy .AppX file?
3. How to use Application Deployment (WinAppDeployCmd.exe) tool?
1. Why .AppX Deployment?
Often when you write a Windows Phone application you do not want to give users the full source code. In such cases it is possible to share only the build file and deploy it to a device or emulator. You can accomplish this using the Windows Phone Application Deployment tool that comes with the RTM version of Windows Phone Developer Tools.
2. What are prerequisites to deploy .AppX file?
WinAppDeployCmd is a stand-alone tool that comes as part of the Windows 10 SDK installation. To use it we need to follow below steps.
Go into the Settings of a Windows 10 phone device and search for Update & Security category and turn on Developer Mode.
3. How to use Application Deployment (WinAppDeployCmd.exe) tool?
Before .AppX deployment, first we need to generate .AppX file from our existing project. So first create new project name is (Ex: Hello World)
If you want to add some code in xaml page, lets add below code in MainPage.xaml.
XAML
<Page x:Class="Hello_World.MainPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="using:Hello_World" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d"> <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"> <Grid.RowDefinitions> <RowDefinition Height="Auto"/> <RowDefinition Height="Auto"/> </Grid.RowDefinitions> <!--Title--> <TextBlock Text="Hello World" Grid.Row="0" Margin="12" FontSize="25" FontWeight="Bold"/> <TextBlock Text="A sample for understanding Windows 10 .Appx file deployment with Application Deployment (WinAppDeployCmd.exe) tool" TextWrapping="Wrap" Grid.Row="1" Margin="12"/> </Grid> </Page>
Press F5 to run project, and now its time to generate .AppX file, so please follow below steps for it.
Step 1: Right click on your Project=>Store=>Create App Packages
Step2: In the Create App Packages wizard, select 'No' If you want to create a local package
Step3: The next dialog provides a choice of processor platforms to target. However, if you are using platform specific binaries in your app, you’ll need to build separate packages for each platform. In this article, we selected the 'ARM' platform and now press the “Create” button. Then wizard gives us a link to where the package was created.
So now you can get the path where .AppX has been created like below:
Please copy above .Appx file path, which we need to use it in deployment.
Okay, now it's time to .AppX deployment with WinAppDeployCmd tool, which is located from the C:\Program Files (x86)\Windows Kits\10\bin\x86\ directory (based on your installation path for the SDK). So open command prompt and change directory path to this.
We can also list all the available target devices on the network using same subnet and use respective IP Address for specific device.
Below syntax is common possibility that you can used to install .appx with WinAppDeployCmd.exe
- WinAppDeployCmd install -file <Appx file path> -ip <address> -pin <p>
He re we can read list of possible syntax of WinAppDeployCmd.exe.
Now install the our "Hello World_1.0.0.0_ARM_Debug.appx" app package to a Windows 10 phone device with an IP address of 127.0.0.1, with a PIN of A1B2C3.
For example:
WinAppDeployCmd install -file "D:\Windows Phone\Subbu\UWP\Hello World\Hello World\AppPackages\Hello World_1.0.0.0_ARM_Debug_Test\Hello World_1.0.0.0_ARM_Debug.appx" -ip 127.0.0.1 -pin A1B2C3
Note: A pin if it is required to establish a connection with the target device. (You will be prompted to retry with the -pin option if authentication is required.)
One we tap on our app icon from app list, the screen could be like below:
Important Notes:
1. Make sure to enable developer mode for windows 10 devices, before .appx deployment. Otherwise you will get below error
"Error : DEP0001 : Unexpected Error: To install this application you need either a Windows developer license or a sideloading-enabled system. (Exception from HRESULT: 0x80073CFF)"
2. This sample will be work on all window 10 devices OS devices. And this sample was tested in Lumia 735 device with Windows 10 OS (version 1511).
3. Windows 10 SDK works best on the Windows 10 operating system. And it is also supported on: Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows Server 2008 R2, but not all tools are supported on these operating systems
4. This article is developed on windows 8.1 OS with 64 bit.
Help me with feedback:
Thank you for reading my article. Drop all your questions/comments in QA tab give me your feedback with star rating (1 Star - Very Poor, 5 Star - Very Nice).
From : https://code.msdn.microsoft.com/windowsapps/UWP-Apps-How-to-instal-d20eb116#content
留言
張貼留言