|
1 |
| ---- |
2 |
| -id: running-on-device-windows |
3 |
| -title: Running On Device |
4 |
| -layout: docs |
5 |
| -category: Guides (Windows) |
6 |
| -permalink: docs/running-on-device-windows.html |
7 |
| ---- |
8 |
| - |
9 |
| -## Running the Universal Windows App with react-native-cli |
10 |
| - |
11 |
| -You can deploy your react-native-windows app to the Desktop using the [react-native-cli](http://npmjs.com/packages/react-native-cli): |
12 |
| -``` |
13 |
| -react-native run-windows |
14 |
| -``` |
15 |
| -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. |
16 |
| - |
17 |
| -## Running the Universal Windows App with Visual Studio |
18 |
| - |
19 |
| -Open your solution in Visual Studio 2015, 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. |
20 |
| - |
21 |
| -### Desktop |
22 |
| - |
23 |
| -Set the Platform build target to something compatible with your host OS, and choose the Local Machine deployment target. |
24 |
| - |
25 |
| - |
26 |
| - |
27 |
| -### Mobile Emulator |
28 |
| - |
29 |
| -Set the Platform build target to something compatible with your host OS, and choose the Mobile Emulator you wish to deploy to. |
30 |
| - |
31 |
| -You may have to install the Windows 10 Mobile emulators for Visual Studio. Instructions are [here](https://msdn.microsoft.com/en-us/windows/uwp/debug-test-perf/test-with-the-emulator). You may also have to enable Hyper-V on your machine, instructions are [here](https://msdn.microsoft.com/library/windows/apps/xaml/jj863509.aspx). |
32 |
| - |
33 |
| - |
34 |
| - |
35 |
| -### Device |
36 |
| - |
37 |
| -Set the Platform build target to something compatible with your device OS (typically ARM), and choose the Device deployment target. |
38 |
| - |
39 |
| - |
40 |
| - |
41 |
| -_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. |
42 |
| - |
43 |
| -_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](https://social.msdn.microsoft.com/Forums/windowsapps/en-US/74fafd96-50cf-4d77-9d7a-41620c5487a5/uwpsdkipoverusbsvc-service-missing-in-windows-10-rc-build-10240?forum=wpdevelop) . |
44 |
| - |
45 |
| -### Xbox |
46 |
| - |
47 |
| -Assuming you have already [enabled Developer Mode on your Xbox](https://msdn.microsoft.com/en-us/windows/uwp/xbox-apps/devkit-activation), deploying to Xbox is easy, just follow the instructions to set up your development environment for Remote Machine deployment [here](https://msdn.microsoft.com/en-us/windows/uwp/xbox-apps/development-environment-setup). |
48 |
| - |
49 |
| - |
50 |
| - |
51 |
| -## Accessing development server from device |
52 |
| - |
53 |
| -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. |
54 |
| - |
55 |
| -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`](https://github.com/Microsoft/react-native-windows/blob/master/ReactWindows/ReactNative.Shared/DevSupport/DevServerHelper.cs#L22) |
56 |
| - |
57 |
| -## Using offline bundle |
58 |
| - |
59 |
| -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`. |
60 |
| - |
61 |
| - |
62 |
| - |
63 |
| -Before deploying with this configuration, you'll have to generate the `index.windows.bundle` file with the following command: |
64 |
| - |
65 |
| -``` |
66 |
| -react-native bundle --platform windows --entry-file index.windows.js |
67 |
| - --bundle-output windows\myapp\ReactAssets\index.windows.bundle |
68 |
| - --assets-dest windows\myapp\ReactAssets |
69 |
| -``` |
70 |
| - |
71 |
| -To generate the release (minified) bundle, add the `--dev false`: |
72 |
| - |
73 |
| -``` |
74 |
| -react-native bundle --platform windows --entry-file index.windows.js |
75 |
| - --bundle-output windows\myapp\ReactAssets\index.windows.bundle |
76 |
| - --assets-dest windows\myapp\ReactAssets |
77 |
| - --dev false |
78 |
| -``` |
79 |
| - |
80 |
| -Be sure to update the paths to match the path to your ReactAssets folder. |
81 |
| - |
82 |
| -To create an app package and upload your app to the Windows store, [follow these instructions](https://docs.microsoft.com/en-us/windows/uwp/packaging/packaging-uwp-apps#create-an-app-package). |
| 1 | +--- |
| 2 | +id: running-on-device-windows |
| 3 | +title: Running On Device |
| 4 | +layout: docs |
| 5 | +category: Guides (Windows) |
| 6 | +permalink: docs/running-on-device-windows.html |
| 7 | +--- |
| 8 | + |
| 9 | +## Running the Universal Windows App with react-native-cli |
| 10 | + |
| 11 | +You can deploy your react-native-windows app to the Desktop using the [react-native-cli](http://npmjs.com/packages/react-native-cli): |
| 12 | +``` |
| 13 | +react-native run-windows |
| 14 | +``` |
| 15 | +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. |
| 16 | + |
| 17 | +## Running the Universal Windows App with Visual Studio |
| 18 | + |
| 19 | +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. |
| 20 | + |
| 21 | +### Desktop |
| 22 | + |
| 23 | +Set the Platform build target to something compatible with your host OS, and choose the Local Machine deployment target. |
| 24 | + |
| 25 | + |
| 26 | + |
| 27 | +### Mobile Emulator |
| 28 | + |
| 29 | +Set the Platform build target to something compatible with your host OS, and choose the Mobile Emulator you wish to deploy to. |
| 30 | + |
| 31 | +You may have to install the Windows 10 Mobile emulators for Visual Studio. Instructions are [here](https://msdn.microsoft.com/en-us/windows/uwp/debug-test-perf/test-with-the-emulator). You may also have to enable Hyper-V on your machine, instructions are [here](https://msdn.microsoft.com/library/windows/apps/xaml/jj863509.aspx). |
| 32 | + |
| 33 | + |
| 34 | + |
| 35 | +### Device |
| 36 | + |
| 37 | +Set the Platform build target to something compatible with your device OS (typically ARM), and choose the Device deployment target. |
| 38 | + |
| 39 | + |
| 40 | + |
| 41 | +_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. |
| 42 | + |
| 43 | +_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](https://social.msdn.microsoft.com/Forums/windowsapps/en-US/74fafd96-50cf-4d77-9d7a-41620c5487a5/uwpsdkipoverusbsvc-service-missing-in-windows-10-rc-build-10240?forum=wpdevelop) . |
| 44 | + |
| 45 | +### Xbox |
| 46 | + |
| 47 | +Assuming you have already [enabled Developer Mode on your Xbox](https://msdn.microsoft.com/en-us/windows/uwp/xbox-apps/devkit-activation), deploying to Xbox is easy, just follow the instructions to set up your development environment for Remote Machine deployment [here](https://msdn.microsoft.com/en-us/windows/uwp/xbox-apps/development-environment-setup). |
| 48 | + |
| 49 | + |
| 50 | + |
| 51 | +## Accessing development server from device |
| 52 | + |
| 53 | +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. |
| 54 | + |
| 55 | +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`](https://github.com/Microsoft/react-native-windows/blob/master/ReactWindows/ReactNative.Shared/DevSupport/DevServerHelper.cs#L22) |
| 56 | + |
| 57 | +## Using offline bundle |
| 58 | + |
| 59 | +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`. |
| 60 | + |
| 61 | + |
| 62 | + |
| 63 | +Before deploying with this configuration, you'll have to generate the `index.windows.bundle` file with the following command: |
| 64 | + |
| 65 | +``` |
| 66 | +react-native bundle --platform windows --entry-file index.windows.js |
| 67 | + --bundle-output windows\myapp\ReactAssets\index.windows.bundle |
| 68 | + --assets-dest windows\myapp\ReactAssets |
| 69 | +``` |
| 70 | + |
| 71 | +To generate the release (minified) bundle, add the `--dev false`: |
| 72 | + |
| 73 | +``` |
| 74 | +react-native bundle --platform windows --entry-file index.windows.js |
| 75 | + --bundle-output windows\myapp\ReactAssets\index.windows.bundle |
| 76 | + --assets-dest windows\myapp\ReactAssets |
| 77 | + --dev false |
| 78 | +``` |
| 79 | + |
| 80 | +Be sure to update the paths to match the path to your ReactAssets folder. |
| 81 | + |
| 82 | +To create an app package and upload your app to the Windows store, [follow these instructions](https://docs.microsoft.com/en-us/windows/uwp/packaging/packaging-uwp-apps#create-an-app-package). |
0 commit comments