id | title | layout | category | permalink |
---|---|---|---|---|
running-on-device-windows |
Running On Device |
docs |
Guides (Windows) |
docs/running-on-device-windows.html |
You can deploy your react-native-windows app to the Desktop using the react-native-cli:
react-native run-windows
For more information on the kinds of options and flags available for deploying to devices and emulators, use the --help
flag to get the command usage information.
Open your solution in Visual Studio, follow the instructions below for the device family you want to deploy to, and press F5. Visual Studio will pull in the NuGet dependencies, build, deploy, and launch the application.
Set the Platform build target to something compatible with your host OS, and choose the Local Machine deployment target.
Set the Platform build target to something compatible with your host OS, and choose the Mobile Emulator you wish to deploy to.
You may have to install the Windows 10 Mobile emulators for Visual Studio. Instructions are here. You may also have to enable Hyper-V on your machine, instructions are here.
Set the Platform build target to something compatible with your device OS (typically ARM), and choose the Device deployment target.
Note: If you haven't already, you'll also need to enable Developer Mode on your device under Settings, Update & security, For developers, Developer Mode.
Note: If you see Unexpected Error: -1988945906
, check that the Windows Phone IP over USB Transport (IpOverUsbSvc)
service is listed and running in the Services app. If the IpOverUsbSvc is not running follow the instructions listed in the forum response to this question .
Assuming you have already enabled Developer Mode on your Xbox, deploying to Xbox is easy, just follow the instructions to set up your development environment for Remote Machine deployment here.
If you are running the Universal Windows app on a device or Xbox, you'll need to configure the IP address of the DevSupportManager
to match your machine's IP address.
We're working on creating a settings page to manage the debug server host address, but for now you can statically configure it in DevServerHelper
If you generated your project using rnpm-plugin-windows
, the solution is already set up with two Configurations for running from an offline bundle, DebugBundle
and ReleaseBundle
.
Before deploying with this configuration, you'll have to generate the index.windows.bundle
file with the following command:
react-native bundle --platform windows --entry-file index.js
--bundle-output windows\myapp\ReactAssets\index.windows.bundle
--assets-dest windows\myapp\ReactAssets
To generate the release (minified) bundle, add the --dev false
:
react-native bundle --platform windows --entry-file index.js
--bundle-output windows\myapp\ReactAssets\index.windows.bundle
--assets-dest windows\myapp\ReactAssets
--dev false
Be sure to update the paths to match the path to your ReactAssets folder.
To create an app package and upload your app to the Windows store, follow these instructions.