/// <summary> /// Default ctor /// </summary> public ApkRunner(IIde ide, string apkPath, string packageName, string activity, bool debuggable, int launchFlags) { this.ide = ide; this.apkPath = apkPath; this.packageName = packageName; this.activity = activity; this.debuggable = debuggable; this.launchFlags = launchFlags; cancellationTokenSource = new CancellationTokenSource(); outputPane = ide.CreateDot42OutputPane(); DeployApk = true; // Load package try { var apk = new ApkFile(apkPath); if (!apk.Manifest.TryGetMinSdkVersion(out minSdkVersion)) minSdkVersion = -1; } catch (Exception ex) { minSdkVersion = -1; ErrorLog.DumpError(ex); } }
/// <summary> /// Make sure this log is registered. /// </summary> internal static void EnsureLoaded(IIde ide, bool vsDebugPane) { if (log != null) return; var outputPane = !vsDebugPane ? ide.CreateDot42OutputPane() : ide.CreateDebugOutputPane(); var add = false; lock (logLock) { if (log == null) { log = new OutputPaneLog(outputPane, vsDebugPane?Levels.Info : Levels.Error, vsDebugPane?DContext.VSDebuggerMessage:(DContext?) null); add = true; } } if (add) { AddAdditionalLogger(log); if(vsDebugPane) AddToContext(DContext.VSDebuggerMessage, log); } }
/// <summary> /// Default ctor /// </summary> public LaunchMonitor(IIde ide, IDevice device, string apkPath, string packageName, int apiLevel, int launchFlags, Action<LauncherStates, string> stateUpdate, CancellationToken token) { this.ide = ide; this.device = device; this.apkPath = apkPath; this.packageName = packageName; this.apiLevel = apiLevel; this.launchFlags = launchFlags; this.stateUpdate = stateUpdate; this.token = token; outputPane = ide.CreateDot42OutputPane(); }