From ea9cfe533c8a33f151c2cfa0f12c7c8b3e30ecdd Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Thu, 14 Jul 2016 21:31:55 +0200 Subject: [PATCH] [xharness] Don't use variables (isSimulator) before they've been initialized. (#397) Fixes an issue where we would try to fetch crash logs from device when running in the simulator. --- tests/xharness/AppRunner.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/xharness/AppRunner.cs b/tests/xharness/AppRunner.cs index 0efc80576a..00ce306f98 100644 --- a/tests/xharness/AppRunner.cs +++ b/tests/xharness/AppRunner.cs @@ -311,13 +311,15 @@ namespace xharness public async Task RunAsync () { - CrashReportSnapshot crash_reports = new CrashReportSnapshot () { Device = !isSimulator, Harness = Harness, Log = main_log, Logs = Logs, LogDirectory = LogDirectory }; + CrashReportSnapshot crash_reports; LogStream device_system_log = null; LogStream listener_log = null; Log run_log = main_log; Initialize (); + crash_reports = new CrashReportSnapshot () { Device = !isSimulator, Harness = Harness, Log = main_log, Logs = Logs, LogDirectory = LogDirectory }; + var args = new StringBuilder (); if (!string.IsNullOrEmpty (Harness.XcodeRoot)) args.Append (" --sdkroot ").Append (Harness.XcodeRoot);