Developer sideloading Windows Store apps
[ This article is for Windows 8.x and Windows Phone 8.x developers writing Windows Runtime apps. If you’re developing for Windows 10, see the latest documentation ]
To test your Windows Store app on another device—without publishing it to the Windows Store—use developer sideloading. Developer sideloading allows you to install the app package directly onto one or more devices for testing. This approach can be useful during beta testing to distribute your app to testers.
For instructions for running your app on a remote machine that is running Microsoft Visual Studio, see Run Windows Store apps on a remote machine.
For an overview of beta testing Windows Phone Store apps, Windows Store apps, and Universal Windows apps, see Beta testing your app.
Developer sideloading vs. enterprise sideloading
The details for sideloading differ based on what you use it for. Developer sideloading allows you test your Windows Store app by installing the app package directly onto a test device, without publishing it to the Windows Store. Enterprise sideloading is a common technique used to install internal business and education apps directly onto devices without making them available outside the organization. Here are the important differences between these sideloading contexts.
Developer sideloading | Enterprise sideloading | |
---|---|---|
Longevity | Short-term solution; requires a renewal of the developer license every 30 days | Long-term solution |
Cost | Free | Product keys for enterprise sideloading must be purchased |
Requirements | Registered developer account and developer license | None |
Recommended tools | Visual Studio, Windows PowerShell | DISM platform, Intune, System Center Configuration Manager |
To learn more about enterprise sideloading, see Deploying enterprise apps.
Requirements
There are only a couple of requirements that the test device and user must fulfill for developer sideloading.
The test device must have:
- One of the following operating systems: Windows 8, Windows 8.1, or Windows RT
- PowerShell installed (it is likely already installed)
- A developer license (These steps show you how to get a developer license)
The user must have:
- A Microsoft account, it does not need to be linked to a developer account
Step 1: Create the app package in Visual Studio
This procedure for creating the app package generates the necessary certification and PowerShell script for developer sideloading. For more detailed instructions and options for creating an app package, see Create an app package.
- On your development machine, start Visual Studio. Open the project for the app that you want to create the app package for.
- In Solution Explorer, right-click your project, select Store, and then click Create App Package. This starts the Create App Package wizard.
- When the wizard asks Do you want to build a package to upload to the Windows Store?, choose No because this developer-sideloaded app will not be linked to an identity in the Windows Store. Then click Next.
- The wizard displays the Select and Configure Packages page. You typically leave the default settings for Version, but if your app has a particular versioning scheme, you can change this value. The more important info is in Build configurations. What you select here depends on which language you used to create your app. For more info about customizing the build configurations, visit the "Select and configure your app package section" of Create an app package.
- Click Create. Visual Studio creates the package and displays a link that you can click to open the folder where the app package were created.
Note On the test device, you'll need access to the entire AppPackages folder, including the .resources subfolder, the PowerShell script, and the security certificate. You need these components as part of the package-installation process; it's not enough to just copy the app package (.appx) file itself.
Step 2A: Install the app using the Visual Studio-generated PowerShell script
The easiest way to install an unreleased app is to share the app’s AppPackages directory and run the Add-AppDevPackage.ps1 PowerShell script that Visual Studio generates for you. The PowerShell script walks the user through the steps of acquiring the developer license and installing the certificate. You can also do each of these steps manually. The manual option is presented next, in Step 2B.
When Visual Studio builds a package, it creates an AppPackages directory that contains the .appx certificate files that are necessary to install the app. It also generates an Add-AppDevPackage.ps1 script that you can use to install the app package.
To use the Visual Studio-generated PowerShell script to install an app:
On the test device, use the File Explorer to open your app's AppPackages subfolder
Right-click the Add-AppDevPackage.ps1 PowerShell file. From the context menu, select Run with PowerShell.
In the PowerShell window, you might receive the following prompts depending on whether the device already has a developer license and whether you're installing the test app on the device for the first time by using developer sideloading. Once you respond to these prompts, the app will be installed. If you are prompted to complete one or both of these steps, press Enter to begin.
Obtain or renew a developer license on the test device: A User Account Control (UAC) agreement dialog may appear, prompting you to allow the PowerShell script to make changes to the computer. Click Yes to accept, and provide the administrator password if needed. When prompted to get a developer license, click I Agree. Note the expiration date; that's when the test device will prompt the user to renew the developer license.
Install the certificate: When prompted to install a digital certificate to the computer’s Trusted People certificate store, type Y and press Enter to accept the warning. For subsequent installations of different versions of the app on the same device, this step will not be required.
Go to the Start screen. You now see a tile for the installed app. Click the app tile to start the app.
Step 2B: Perform a manual installation
If you don’t have access to an Add-AppDevPackage.ps1 PowerShell script or system policies prevent you from running the script, you can perform a manual installation instead.
- Obtain or renew a developer license on the test device
- From the Start screen, run PowerShell as an administrator. To do this, right-click the PowerShell icon and click Run as administrator. A User Access Control (UAC) dialog appears, prompting you to allow the script to make changes to your computer. Click OK to confirm.
Note If you can't display the Run as Administrator option, type this in the non-elevated PowerShell window:
start-process powershell.exe -verb runas
. This starts a new, elevated PowerShell process. - In the PowerShell window, type
Show-WindowsDeveloperLicenseRegistration
and press Enter. - A developer license pop-up window appears. Click I Agree.
- A Windows developer sign-in window appears. You can sign in with any Microsoft account (it doesn't need to be linked to a developer account). Enter your information and click Sign In. The system signs you in and displays a confirmation box.
- Click Close. The developer license is now valid for sign-in on the test device.
- Leave the PowerShell window open; you'll need it to install the app package. The app package folder contains a certificate (.cer file) that was used to sign the app package. Before you can install the app package, your device must have this particular certificate in its set of trusted root certificates. Note If you are installing an app that is signed by Microsoft, a Microsoft certificate already exists in the certificate store and you do not need to install a separate certificate.
- From the Start screen, run PowerShell as an administrator. To do this, right-click the PowerShell icon and click Run as administrator. A User Access Control (UAC) dialog appears, prompting you to allow the script to make changes to your computer. Click OK to confirm.
Note If you can't display the Run as Administrator option, type this in the non-elevated PowerShell window:
- Install the certificate
- Transfer the entire AppPackages folder to the test device. Use File Explorer to open that folder.
- Double-click the security certificate file with the .cer extension in the folder. A Certificate wizard will appear. In the General Tab, click Install Certificate. This displays the Certificate Import Wizard.
- In the Store Location group, change the selected option to Local Machine and click Next.
- A User Access Control dialog appears, prompting you to accept the request to provide access. Click OK to confirm.
- In the next screen of the Certificate Import Wizard, change the selected option to Place all certificates in the following store.
- You will now select the certificate store. Click the Browse button. In the Select Certificate Store pop-up window, scroll down and select Trusted People, and then click OK. The option Trusted People is now populated in the Certificate store field.
- Click the Next button. A summary appears of the import setting changes that you made. Click Finish to import the certificate. A confirmation dialog appears, indicating that the certificate was imported successfully.
- Install the app package
- From the Start screen, run PowerShell as an administrator. To do this, right-click the PowerShell icon and click Run as administrator. A User Access Control dialog appears, prompting you to allow the script to make changes to your computer. Click Yes to accept.
Note If you can't display the Run as Administrator option, type this in the non-elevated PowerShell window:
start-process powershell.exe -verb runas
. This starts a new, elevated PowerShell process. - In the PowerShell window, change the current directory of the prompt so that it points to the location of the app package that you want to install.
- At the PowerShell prompt, type
Add-AppxPackage
and then the name of the file in this folder with the .appx file extension. Usually this file has version, platform, and build-configuration strings as part of its name. For example,Add-AppxPackage MyTestApp_1.0.0-_AnyCPU_Debug.appx
. - If the app package installation is successful, no status message is displayed in the PowerShell window; you just get a new prompt. If there's a problem with the app-package installation, however, the PowerShell window displays a message in red. If this happens, you may be able to get more info about how to fix the problem from the Add-appxpackage documentation on Microsoft TechNet.
Note This procedure installs only a single package, so if your app uses component libraries, include them when you install your app. The correct set of dependencies is automatically included in the Dependencies folder created by Visual Studio as part of the project structure. Add the
-DependencyPath
argument after the .appx file name, and reference the path and name of the dependency package. For example,Add-AppxPackage MyTestApp_1.0.0-_AnyCPU_Debug.appx –DependencyPath .\Dependencies\Microsoft.WinJS.1.0.RC.appx
. - Go to the Start screen. You now see a tile for the app. Click the app tile to start the app. If the app runs, you've successfully installed the app package to your test device.
- From the Start screen, run PowerShell as an administrator. To do this, right-click the PowerShell icon and click Run as administrator. A User Access Control dialog appears, prompting you to allow the script to make changes to your computer. Click Yes to accept.
Note If you can't display the Run as Administrator option, type this in the non-elevated PowerShell window:
More info about Add-AppxPackage and related PowerShell cmdlets
The Add-AppxPackage cmdlet has more options that aren't documented here. For example, you can explicitly specify a path or disable development mode. For more info, see Add-appxpackage documentation on Microsoft TechNet.
There are also additional PowerShell cmdlets in the same module that perform actions such as removing apps, reading installation logs, and getting info about app packages that have already been installed. For more info, see App Installation Cmdlets.
Updating a developer sideloaded app
To update the test app, you must repeat the installation process with the updated app package. On the second installation, some steps may not be necessary—for example, obtaining or renewing a developer’s license and installing the certificate.
No expiration for developer-sideloaded apps
If you want to restrict the use of the test app after a specified period of time, you must build support for that into your app. Otherwise, testers who already have your app installed will be able to continue using it.
The developer-sideloaded app does not expire, and remains available for use as long as the device has a valid developer license.
Note When the user attempts to open an app that requires a developer license, the user is prompted to renew the license if it has expired. This step requires the user to sign in to their Microsoft account.