Whether you're using DirectX or unity to develop holographic applications, you'll use Visual Studio 2015来 to debug and deploy your app. In this section, you will learn the following:
- How to deploy your app to HoloLens with Visual Studio
- How Visual Studio 2015 uses the built-in HoloLens emulator
- How to debug a holographic application
PrerequisitePrerequisites
- Install the development tools.
- For 2D apps, create a UWP project in Visual Studio Update 1 and later. or start using unity to develop holographic applications. HoloLens supports C #, C + +, and JavaScript projects.
Open developer modeenabling Developer Mode
Before you start connecting the developer tools to HoloLens, you first need to turn on developer mode on your device.
- Power on the device and wear the HoloLens
- Use the bloom (Bloom) gesture to start the Start menu
- Gaze at the Settings menu and then use the tap gesture. Apply the second click Placement settings to your environment. Setting up the app starts after you've placed it.
- Select the update menu
- Select the developer Options Menu
- Turn on developer mode . This allows you to deploy apps from Visual Studio to HoloLens
- Optional: Scroll the interface and open the device portal option. This will allow you to connect to the Windows Devices Console (Windows device Portal) on HoloLens from your browser.
deploy apps via Wi-Fi deploying an app over Wi-Fi
Set the compilation configuration of your app to x86
Deployment target Select remote machine
For C + + and JavaScript projects, go to Project > Properties > Configuration Properties > Debugging. For C # projects, a pop-up window that configures the connection automatically appears.
- Enter the device IP address or device name . On HoloLens, you can find your IP address in Settings > Network & Internet > Advanced Options , or ask Cortana directly: "What is my IP address?" "(What's my IP address?)
- Set the validation mode to Universal (unencrypted protocol)
Check debug > Start Debuggin to start deployment and commissioning
For the first deployment to HoloLens, you will need to verify your PIN code and follow the pairing device guidelines below.
Pairing your devices pairing your device
The first time you deploy an app from Visual Studio to HoloLens, you will need to verify the PIN code. On HoloLens, generate a PIN by launching the settings app, go to Update > for Developers, and then tap pairing . A PIN will appear on the HoloLens and then enter this pin in Visual Studio. After pairing is finished, click the done button to hide this prompt. At this point the PC has been paired with HoloLens and you will be able to automatically deploy the app to HoloLens. Repeat this step for each of the different PCs used for development.
To remove HoloLens and PC direct pairing, you can start the Settings app, go to Update > for Developers, and click Clear.
Deploy the app to the HoloLens simulator deploying an app to the HoloLens Emulator
- Make sure you have the HoloLens simulator installed
- Set the compilation configuration of your app to x86
3. Deployment target selected as HoloLens emulator
4. Check debug > Start Debuggin to start deployment and commissioning
graphical Debug Graphic Debugger
Visual Studio graphical debugging analysis tools are useful when you develop and optimize holographic applications. See more details on MSDN.
To start using the graphical debugger for HoloLens
- Follow the instructions above to set the deployment target to HoloLens device or simulator
- Go to Debug > Graphics > Start diagnostics
- When you do this for the first time, you get an "Access denied denied" error. Restart HoloLens to allow permissions to be updated, and then try again.
Performance Analysis Profiling
The Visual Studio Performance Analysis tool allows you to analyze the performance and resource utilization of your app. It includes tools for analyzing CPU, memory, graphics performance, and network utilization. You can see more details on MSDN.
Start using the Performance Analyzer for HoloLens
- Follow the instructions above to set the deployment target to HoloLens device or simulator
- Go to Debug > Start Diagnostic Tools without Debugging ...
- Select the tool you want to use
- Click to start
- When you do this for the first time, you get an "Access denied denied" error. Restart HoloLens to allow permissions to be updated, and then try again.
Translated from: Https://developer.microsoft.com/en-us/windows/holographic/using_visual_studio
HoloLens development Notes-using Visual Studio with Visual Studio