private static void TryLaunchApp(AppInfo selectedApp) { if (!selectedApp.IsDeviceAvailable) { AppInfoExtensions.HandleNoDeviceAvailableInView(selectedApp); return; } Device primaryDevice = selectedApp.AvailableDevices[0]; if (!primaryDevice.IsAppInstalled(selectedApp)) { Logger.Info(selectedApp + " wasn't installed on the device '" + primaryDevice + "' will install it now."); primaryDevice.Install(selectedApp); } selectedApp.LaunchAppOnPrimaryDevice(); }
public void InstallAndLaunchNewBuiltApp(AppInfo appInfo) { if (!appInfo.IsDeviceAvailable) { AppInfoExtensions.HandleNoDeviceAvailableInView(appInfo); UpdateBuildProgressBar("Launching App aborted", 100); ViewModel.OpenLocalBuiltAppsDirectory(); return; } Device primaryDevice = appInfo.AvailableDevices[0]; if (primaryDevice.IsAppInstalled(appInfo)) { UpdateBuildProgressBar(appInfo.Name + " was already installed, uninstalling it.", 90); primaryDevice.Uninstall(appInfo); } UpdateBuildProgressBar("Installing " + appInfo.Name + " on " + primaryDevice.Name, 95); primaryDevice.Install(appInfo); LaunchApp(appInfo, primaryDevice); }