test windows 8 store apps on surface

I have been getting this question more and more over the past few weeks so I figured it was easier to post here instead of copying and pasting in email over and over again.
People want to test their Windows 8 Store apps on Surface and sometimes get hung up on the details related to sideloading. If you are simply testing as a developer, you have a couple options that I detail below.
- Remote debugging. This is accomplished with the Remote Tools. I was successfully able to connect to my Surface over my local network from my Windows 8 machine to launch and remote debug. Just set “Local Machine” to “Remote Machine” in the toolbar of VS.
OR (the next 2 generate the same result)
- Build in VS as you normally would and then use the “Create App Packages…” wizard in VS. This can be found in the Project… Store… menu (this will only be available if you are working on a Windows 8 Store app)
- EASIEST: Open VS Command prompt, navigate to the project folder, and run: msbuild /p:Platform=ARM projectname(ex: msbuild /p:Platform=ARM myproject.jsproj (or csproj if working in C#)) This will automatically create the appx and needed Powershell file to install it. You only need the /p (property switch if you are targeting Any CPU in your app (which most are). Otherwise, you can go into the Solution Configuration Manager and just select ARM as the target platform and simply type msbuild name.jsproj
After you do either of the above, there will be a AppPackages directory in the VS project directory. In there will be the ARM folder with the appx and Powershell file needed to install it. Copy that ARM folder onto a USB drive to install onto Surface
INSTALLING ON SURFACE (or any other Windows 8 machine)
This is actually pretty easy, but the first time you install a sideloaded appx, you need to obtain a developer certificate for the device. You would just use your Microsoft account when prompted.
- Go into the folder on the USB drive and right-click the Powershell commandlet Add-AppDevPackage.ps1and select Run with Powershell
- It will most likely tell you that you need to run this as an Administrator and kick off a UAC prompt. Select Yes.
- Then it will tell you need to obtain and install a dev cert for the Surface. It will open a window where you log in with your Microsoft account
- The dev cert is downloaded and installed:
- You app then installs beautifully
Now, subsequent apps, you simply just need to right-click the Powershell script and it will install. I just installed 2 apps on my Surface that I am working on using MSBUILD.
Happy building!
4 replies to “test windows 8 store apps on surface”
Zach
I have done the steps at the bottom 1-4 and it still doesn’t work. I get a final note that says “Install the signing certificate.” I assumed this was the security certificate in the folder so I installed that, but it still asks the same thing. I’m not sure what I’m supposed to do, thanks.
Zach
Making some progress with the help of http://social.technet.microsoft.com/wiki/contents/articles/2167.how-to-use-the-certificates-console.aspx
I moved the installed certificates from Intermediate Authorities to Trusted Root using MMC.
But still having some trouble because now it says The root certificate of the signature in the app package must be trusted. I’ll keep trying and post answer if I get it on here for others. Help if you can :)
Zach
opened a thread here: http://social.msdn.microsoft.com/Forums/en-US/toolsforwinapps/thread/26d7d990-38fc-4879-8308-6dd8d2f66f66
Zach
Answer (more detailed in above thread): make sure to install certificate in Local Computer > Trusted Root Certification Authorities > Certificates and/or (not sure I just did both and it worked) Local Computer > Trusted People > Certificates. I was installing the certificate under Current User rather than Local Computer.