Version: Unity 6.1 Alpha (6000.1)
Language : English
Testing and debugging
Android symbols

Debug on Android devices

Unity supports the following ways to debug an application on an Android device:

USB debugging

Unity supports USB debugging for Android devices. To use USB debugging, enable developer options on your device. To do this, refer to Android’s Configure developer options documentation.

Use a USB cable to connect the device to your computer. If you are developing on a Windows computer, you might need to install a device-specific USB driver. Refer to the manufacturer’s website for your device for additional information.

The setup process differs for Windows and macOS. For more information on connecting your Android device to the SDK, refer to the Run Your App section of the Android Developer documentation.

Android Debug Bridge

Unity supports Android Debug Bridge (ADB) over USB and wireless connection for Android devices. Wireless connection is useful when you can’t perform USB debugging, when a controller is plugged into the Android device, or when debugging VRVirtual Reality More info
See in Glossary
applications and you insert the Android device into the VR Kit.

Connect via USB

To connect an Android device to Unity through ADBAn Android Debug Bridge (ADB). You can use an ADB to deploy an Android package (APK) manually after building. More info
See in Glossary
using a USB:

  1. Enable ADB on the device. For information on how to do this, refer to Set up a device for development.
  2. Use a USB cable to connect your Android device to the machine running Unity.
  3. Navigate to File > Build Profiles.
  4. Select or add an Android build profileA set of customizable configuration settings to use when creating a build for your target platform. More info
    See in Glossary
    .
  5. From the Run Device build setting, select your device from the available options. If your device doesn’t appear, click Refresh.
  6. Select Build And Run to build the application and run it on the device.

Connect wirelessly

To wirelessly connect an Android device to Unity through ADB:

  1. Enable wireless ADB on the device. For information on how to do this, refer to Connect to your device using Wi-Fi.
  2. Find the IP address of your device. The process to do this depends on your device manufacturer.
  3. Navigate to File > Build Profiles.
  4. Select or create an Android build profile.
  5. From the Run Device build setting, select the <Enter IP> option.
  6. In the window that opens, enter the IP address and port number of the device. If the device’s port number is 5555, you don’t need to enter it.
  7. Select Add. Once Unity connects to the device, the device name appears in the Run Device list and is selected.
  8. Select Build And Run to build the application and run it on the device.

View Android logs

When you run a build of your application on an Android device, Android collects messages such as stack traces and logs from scriptsA piece of code that allows you to create your own Components, trigger game events, modify Component properties over time and respond to user input in any way you like. More info
See in Glossary
. To see these messages, Android provides the logcat command-line tool. To use this tool with your Unity application, either:

  • Launch ADB with the logcat parameter:
    $ adb logcat
  • Use the Android Logcat package which implements the logcat command-line tool and displays messages from the application in a dedicated window in Unity.

For more information, refer to Android Logcat.

Testing and debugging
Android symbols