How Do I Deploy a Windows 8 App to Another Device for Testing?

时间:2023-02-03 13:31:23

If your developing a new Windows 8 app and you want to test it on another device (e.g. Surface), you’ll need to use a technique called sideloading. This can easily be done through a few steps that I’ll describe in this post.

What is Sideloading?

Windows 8 Store Apps are deployed through the Windows Store.  This may seem like an obvious statement. However, by default, only Windows Store apps are permitted to install and run on Windows 8. When you install an app from the Windows Store, a Windows Store signed app package is downloaded and installed on your machine. Since only Windows Store signed apps are permitted to be executed on Windows 8, it greatly reduces the introduction of malware. For development and enterprise scenarios, you can use a technique called sideloading to install and run apps that are not Windows Store signed. I’ll cover development sideloading in this post. If you are interested in how to use sideloading for line of business apps in an enterprise, please see this post.

Development Sideloading

Development sideloading is used by Visual Studio to deploy, debug and test your app.

The general requirements for sideloading are:

  1. Your appx package needs to be signed.
  2. The certificate used for signing needs to be trusted.
  3. A policy (or registry key) needs to be set to allow trusted apps to run.

On a development machine, these requirements are automatically met for you by Visual Studio. Visual Studio provides a self-signing test certificate that is used to sign the package. Also, when Visual Studio is installed, a registry key is set to allow trusted apps to run. Therefore, when you debug a Windows 8 Store app using Visual Studio, the app is test certificate signed, deployed, and allowed to run.

How do I Sideload My App on Another PC or ARM Device?

In order to deploy an app, you need an App Package. Visual Studio has functionality to create an App Package you can use to deploy your app to another machine. The following steps are how to create a local App Package.

  1. In Visual Studio Express 2012, choose “Create App Package” in the Store menu. How Do I Deploy a Windows 8 App to Another Device for Testing?  Note: In Visual Studio 2012 Ultimate, the Store menu is in a different location. In the “Project” menu, use the “Store” option .
  2. In the Create App Package wizard, you will want to create a local package. Therefore, answer “No” to the “Do you want to build a package to upload to the Windows Store”. Notice the information text indicates this is the option for sideloading. How Do I Deploy a Windows 8 App to Another Device for Testing?
  3. The next dialog provides a choice of processor platforms to target. In most cases, you would want to choose “Any CPU”. This will allow you to target all of the processor platforms and architectures. However, if you are using platform specific binaries in your app, you’ll need to build separate packages for each platform.How Do I Deploy a Windows 8 App to Another Device for Testing?
  4. In my example, I’ll just leave the default “Any CPU” and click “Create” How Do I Deploy a Windows 8 App to Another Device for Testing? Note the wizard gives us a link to where the package was created.

If we click the link, here is an example of what was created:

How Do I Deploy a Windows 8 App to Another Device for Testing?

Here is a quick summary of the relevant files in the package directory:

Appx package (MyApp_1.0.0.0_AnyCPU_Debug.appx)

The appx package is a zip file of all of the program files for your app. This file gets deployed and installed into Windows. Try renaming the extension to “.zip” and open the zip file to see what is inside. Don’t forget to change it back before you try and deploy it.

Developer test certificate (MyApp_1.0.0.0_AnyCPU_Debug.cer)

This is your development certificate. This is the certificate that was used to sign the appx package.

PowerShell script (Add-AppDevPackage.ps1)

This PowerShell script can be used to install the development certificate and install the App.

Installing the App on the Target Machine

Everything you need to deploy the app is included in the package directory created by Visual Studio. I usually copy the directory to a USB memory stick to transfer the app to the target machine. On the target machine, you just need to run the PowerShell script (Add-AppDevPackage.ps1) to deploy the app. You can do this easily by right clicking on the script and selecting “Run with PowerShell”.

How Do I Deploy a Windows 8 App to Another Device for Testing?

The first action performed by the script is to install the certificate. It needs to run elevated in order to perform this step. If PowerShell isn’t running elevated, the script will prompt to start an elevated process to install the certificate.

How Do I Deploy a Windows 8 App to Another Device for Testing?

You will be warned and prompted to allow the certificate to be installed.

How Do I Deploy a Windows 8 App to Another Device for Testing?

Once the certificate is installed, the app package is installed.

How Do I Deploy a Windows 8 App to Another Device for Testing?

Your app should now be installed on the target machine. You should be able to find the tile on the Start screen (usually at the end of the list):

How Do I Deploy a Windows 8 App to Another Device for Testing?

The final requirement is to allow trusted apps to run. If your target machine has Visual Studio installed, this requirement will already be met. However, if you don’t have Visual Studio installed, you can meet the requirement through group policy or setting a registry key.  For development purposes, it’s usually easiest to set the registry key.

  • Use RegEdit to navigate to the key: HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\Appx
  • Set AllowAllTrustedApps (REG_DWORD) to the value of 1

Your app should now run on the target machine.

One final note… This is the process for development sideloading. There is a more formal process for enterprise sideloading.  If you are interested in enterprise sideloading, please start with this post.

Source to : http://blogs.msdn.com/b/patricka/archive/2012/11/05/how-do-i-deploy-a-windows-8-app-to-another-device-for-testing.aspx

How Do I Deploy a Windows 8 App to Another Device for Testing?的更多相关文章

  1. 在桌面程序上和Metro/Modern/Windows store app的交互(相互打开,配置读取)

    这个标题真是取得我都觉得蛋疼..微软改名狂魔搞得我都不知道要叫哪个好.. 这边记录一下自己的桌面程序跟windows store app交互的过程. 由于某些原因,微软的商店应用的安全沙箱导致很多事情 ...

  2. Windows Phone App Studio发布重要更新-支持Windows 8.1 源代码生成

    自2013年8月Apps Team发布Windows Phone App Studio以来,由于其低入门门槛和较好的易用性,用户和项目数量增长迅速,从Windows Phone Developer B ...

  3. Windows Phone App的dump 文件分析

    前言 我们在发布了自己的App以后,Windows Phone的Error Report机制会帮助我们收集程序的崩溃信息并发送到微软的服务器上,这可以辅助开发者提高App的稳定性. 那么如何利用这些d ...

  4. Windows Phone Studio-任何人都能开发Windows Phone App的在线工具

    在一段时间的内测以后,微软于今天早些时候发布了其Windows Phone应用开发的在线工具,名字叫做Windows Phone Studio.其意义在于,通过简单的内容添加和样式选择,实现Windo ...

  5. Windows Phone App Studio 无码开发手机应用

    上周微软发布了一款基于Web的Windows Phone应用开发工具 "Windows Phone App Studio".它与大家熟知Visual Studio的最大不同之处是W ...

  6. 打造理想的Windows 10 APP开发环境的5个步骤

    (此文章同时发表在本人微信公众号"dotNET每日精华文章",欢迎右边二维码来关注.) 题记:微软即将发布Windows 10手机版,实际上很多人现在已经开始在开发Windows ...

  7. Windows Store App 过渡动画

    Windows Store App 过渡动画     在开发Windows应用商店应用程序时,如果希望界面元素进入或者离开屏幕时显得自然和流畅,可以为其添加过渡动画.过渡动画能够及时地提示用户屏幕所发 ...

  8. [Windows Phone] APP上架,遇到错误2001的解决方案。(Error:2001)

    [Windows Phone] APP上架,遇到错误2001的解决方案.(Error:2001) 问题情景 最近在开始玩Windows Phone的开发,开发的过程中虽然有点小挫折,但是参考网络许多前 ...

  9. Windows metro app wcf 地址可配置

    在Windows metro app中调用wcf服务可以通过添加 “服务引用”来实现.一旦项目发布则不可修改.这个和桌面开发不一样. 现在我们通过读取文本的方式来读取wcf地址. 1.添加所需引用的w ...

随机推荐

  1. 【笔记】js parentsNode,lastChild,appendChild,insertBefore,nextSibling的意义及运用

    这几天看书看到这几个属性做几个笔记 parentNode:顾名思义,就是获取某元素的父元素等同于jq的parent(). *注意一下,在调用parentNode 方法的时候 调用的对象必须是用ID 或 ...

  2. github初体验

    1.服务端 首先得有一个github账号 用户名和密码 2.客户端 github是服务端,要想在自己电脑上使用git我们还需要一个git客户端,我这里选用msysgit,这个只是提供了git的核心功能 ...

  3. SPSS数据分析—判别分析

    判别分析作为一种多元分析技术应用相当广泛,和其他多元分析技术不同,判别分析并没有将降维作为主要任务,而是通过建立判别函数来概括各维度之间的差异,并且根据这个判别函数,将新加入的未知类别的样本进行归类, ...

  4. sql server 2008 r2 出问题

    1.想利用sql2008的数据挖掘功能,以为是没有安装全,所以就卸载了. (1)利用Windows Installer Clean UP将以前的卸载干净 (2)出现了Could not open ke ...

  5. LOJ116 - 有源汇有上下界最大流

    原题链接 Description 模板题啦~ Code //有源汇有上下界最大流 #include <cstdio> #include <cstring> #include & ...

  6. Dotfuscator代码混淆工具的使用

    关于Dotfuscator,VS自带了一个社区版的源代码保护工具,不过它只有基本的混淆命名的功能.专业版功能很多,可以混淆流程,密字符串,加入水印,程序签名等. 工具/原料   Dotfuscator ...

  7. 【OS X系统】Xcode中搭建Python环境。

    虽然按照网上教程一步一步来,但还是遇到了几个错误点,现整理出来,主要是自己做个笔记,同时也希望能帮助到其他像我一样第一次在Xcode上搭建Python环境的人.首先感谢原作者:https://zhid ...

  8. DSU模板&lpar;树的启发式合并&rpar;

    摘自Codeforces博客 With dsu on tree we can answer queries of this type: How many vertices in subtree of ...

  9. 2016级算法期末模拟练习赛-C&period;AlvinZH的青春记忆II

    1084 AlvinZH的青春记忆II 思路 中等题,二分. 简化题意,一列数字,每秒会自动-1,特殊操作可以使一个数在1s内-k,问这些数都减至0需要多久. 答案肯定在[1,xMax]之间,采用二分 ...

  10. C&num;接收xmlrpc接口返回哈希表格式

    C#在调用xmlrpc接口时返回的是int值就可以直接获取,最近在调用一个接口是获取一个账号记录的详细信息,xmlrpc接口返回的是一个哈希值. 所以直接用int或者Hashtable 来获取返回值执 ...