Skip to content

Logcat watcher

MilleBo edited this page Mar 3, 2017 · 1 revision

Testura.Android provides functionally to watch the logcat for different tags. To use it you simply have to extend the LogcatWatcher class or use the EventLogcatWatcher.

EventLogcatWatcher

EventLogcatWatcher will fire an event every time it find something that matches the provided tag(s).

Usage

public void StartLogcatWatcher(IAndroidDevice device)
{
	var eventLogcatWatcher = new EventLogcatWatcher(device.Configuration, new[] {"myTag "}, flushLogcat: true);
	eventLogcatWatcher.NewOutputEvent += EventLogcatWatcherOnNewOutputEvent;
}

private void EventLogcatWatcherOnNewOutputEvent(object sender, string line)
{
	// Found a new line with the tag, handle it.
}

Clone this wiki locally