

- #Speed to debug android studio thru device apk#
- #Speed to debug android studio thru device install#
- #Speed to debug android studio thru device code#
- #Speed to debug android studio thru device license#
We’re almost there! Now that you have your code running on your device let’s go back to the build settings dialog and make sure the right options are selected. In the future you can just return there to build and deploy changes to your device. As to why you can do it from the menu but not the dialog, I have no idea.Īfter doing this once the “Build and Run” button in the build settings dialog was working properly for me.
#Speed to debug android studio thru device apk#
You’ll be asked what to name the APK (I used “test.apk”) and then an APK will be built and sent to your device. The solution that worked for me was to keep the build settings dialog open and “Android” selected as the build platform, then select the “File” menu again and pick “Build and Run”. After unsuccessfully changing EVERY setting possible to see if it would enable the button, I took to the web and found I wasn’t the only one having that problem. Once you have the device selected the next thing to do is build the APK but as you can see in the screenshot above the “Build And Run” button was grayed out for me. If you can’t you can try clicking the “Refresh” button to see if that makes it show up. You should be able to find your Android device. From there select the “Android” platform in the bottom left and then check the “Run device” dropdown. To make sure Unity can see it, go to the “File” menu then “Build settings…“. Next hook up the device to your computer via USB. Hook up an Android device, enable debugging and build an APKīefore you can use your Android device for development you need to follow the instructions here. In my case I was trying to debug some Android specific stuff so there were a few more things I had to do to get debugging code running on the Android to work. Visual Studio is now debugging your game running in Unity!!


Right clicking in the “Project” pane at the bottom shows an “Open C# Project” option that should open your project in Visual Studio but when I tried it, it opened an explorer window instead. The next step is done from within Unity so go ahead and open your project in Unity (or create a new one). Make sure you check the “Microsoft Visual Studio Community” dev tools module (although it says 2017 it worked fine for my VS Community 2019 install) as well as “Android Build Support” (and anything else you need): Now you’ll be presented with list of modules to choose to install. Select “Add” to add a new Unity version to your compute and select a specific version (an LTS version is always a good choice).
#Speed to debug android studio thru device license#
You can find it here.Īfter you get Unity Hub installed, start it up, configure your license and then click on the “Installs” nav item on the left:
#Speed to debug android studio thru device install#
These days Unity Hub is the best way to install and manage different Unity. When installing Visual Studio be sure to select the “Game development with Unity” workload: You can find the Visual Studio Community Edition installer on this website.

If you’ve already installed a Unity version though you can always go back and add the VS dev tools module after the fact. It’s easiest to have Visual Studio installed before before installing your Unity version so that when Unity installs it installs the VS dev tools. I recently set up Unity on a new laptop and things went fairly smoothly so I thought I’d document the process to try to help others out. The first time I tried writing a mobile game using Unity I found it took me way too long to get things set up where I could actually debug code running on the Android device. Using Visual Studio to debug a Unity game on Android device
