In this article we are going to see how to deploy a windows phone application directly from command line version of the Application Deployment Tool. In our earlier article we have seen how to deploy the application directly using the Application Deployment Tool standalone application that comes in the package with both the versions of the SDK. Application Deployment command line tool (XapDeployCmd.exe) will be installed only with the Windows Phone 8 SDK and not with the earlier versions. [more]
The Application Deployment Command Line tool for Windows Phone will be installed automatically while installing the Software Development Kit in the location C:\Program Files (x86)\Microsoft SDKs\Windows Phone\v8.0\Tools\XAP Deployment This tool will work only with the Visual Studio 2012 Update 2 package and not with the normal Visual Studio 2012 version. With this tool the app can be deployed easily from the command prompt with simple tags. Let us see how we can use this tool to deploy the same package which we used in our earlier article.
Navigate to the application build folder and see if the package is available (which is the .XAP file) if not try to build the application through one of the ways which we discussed earlier. If you are planning to deploy the application to the device make sure to connect the device using the USB to the developer machine else to check with the emulator we can directly run the application from the command line. Let us see the steps on how to use the Application Deployment Command Line tool to deploy our application to the emulator.
Steps to deploy the application:
Open command prompt in administrator mode and navigate to the path C:\Program Files (x86)\Microsoft SDKs\Windows Phone\v8.0\Tools\XAP Deployment where the xapDeployCmd.exe is installed as shown in the screen below.
The syntax that to be used to deploy to the emulator and to the physical device are as follows. Basically to deploy your app to the emulator we need to use xd and for physical device de option as shown in the syntax below.
XapDeployCmd.exe <cmd[:param]> <Product ID/Xap FileName> <targetdevice[:param]>
in the syntax first parameter is the command to process, second is the path to the XAP file or the product id which we can get from the application deployment and final parameter is the target device which can be an emulator or the physical device. Use the below codes to deploy the application to device and emulator as per your requirement.
Deploy to Emulator:
XapDeployCmd.exe /installlaunch G:\MyWork\Learning\F5debugHowto85\F5debugHowto85.xap /targetdevice:xd
Deploy to Device:
XapDeployCmd.exe /installlaunch G:\MyWork\Learning\F5debugHowto85\F5debugHowto85.xap /targetdevice:de