Debugging

How to test and debug your Xamarin.Android app

PDF for offline use

Let us know how you feel about this

Translation Quality


0/250

last updated: 2017-12

Overview

Developing Android applications requires running the application, either on physical hardware or using an emulator or simulator. Using hardware is the best approach, but not always the most practical. In many cases, it can be simpler and more cost effective to simulate/emulate Android hardware using one of the emulators described below.

Android SDK Emulator

These articles explain how to use the default emulator that is provided with the Android SDK. This emulator is available for Visual Studio for Windows and Visual Studio for Mac.

Visual Studio Android Emulator

This article explains how to debug and test your Xamarin.Android app using the Android emulator that is built into Visual Studio 2015. This emulator is relatively fast, but it does not support custom device profiles. This emulator is a good choice if you are using Visual Studio 2015 and do not need custom device profiles.

🚫

Note that the Xamarin Android Player has been deprecated. For more information, see the announcement in this blog post.

Debugging on a Device

This article shows how to configure a physical Android device so that Xamarin.Android application can be deployed to it directly from either Visual Studio or Visual Studio or Mac.

Android Debug Log

One very common trick developers use to debug their applications is using Console.WriteLine. However, on a mobile platform like Android there is no console. Android devices provides a log that you will likely need to utilize while writing apps. This is sometimes referred to as "logcat" due to the command typed to retrieve it. This article describes how to use logcat.

Xamarin Workbook

If it's not already installed, install the Xamarin Workbooks app first. The workbook file should download automatically, but if it doesn't, just click to start the workbook download manually.