Sunday, November 4, 2012

WinRT: Deploy a win8 app locally (Sideloading)

After 3 weeks of long development (using spare times from after-working-hours, and weekend), the Windows 8 app that I've developed is almost done with some basic features.

Before submitting the app, the package has to be tested. To run it locally without the debugger's help, it's not so straightforward.
Here're the steps needed:

1) Start package creation using Visual Studio.

2) Sign-in if needed, not needed since I only want to test locally.

3) Then configure the package.

4) Done, and these are all the files created. It comes with a cert.

5) OK, you think you can start installing the cert, by right-click it and install.

6) "Certificate Import Wizard" prompted. Just install in local and next..., until suceess.

7) Then start the PowerShell, run as admin with this command:
a) Windows+R
b) Start-Process powershell -Verb runAs

8) Change the directory if needed, then
a) change directory: cd XXX
b) deploy package: add-appxpackage YYY.appx
where XXX (directory), YYY.appx (executable file) created in step (4).

But not working :(

9) After goggling, we have more job to do.

10) Now start the Microsoft Management Console, type:
a) Windows+R
b) mmc

10) You might need to learn 'How to Use the Certificates Console'

11) Use the import function and you will be greeted by wizard again.

12) Browse to the cert (.cer) created by Visual Studio previously.

13) then click 'Next' all the way till success. You cert is in the root.

14) Back to power-shell again. Deploy package with this command: add-appxpackage YYY.appx

15) VoilĂ !

16) Sometimes, your deployment might fail. From here:

17) One of the possibilities is simulator (or my app locked the resource??) Just turn-off the simulator (thru' "Task Manager") and re-deploy will do.

1 comment:

Mangesh Ghotage said...

Very helpful post. Especially the last "Import certificate" point. Thanks!