Skip to content

Commit

Permalink
feat: don't uninstall app by default
Browse files Browse the repository at this point in the history
  • Loading branch information
rigor789 committed May 20, 2024
1 parent 9d2ec7c commit bac14c0
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions lib/common/mobile/application-manager-base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import * as _ from "lodash";

export abstract class ApplicationManagerBase
extends EventEmitter
implements Mobile.IDeviceApplicationManager {
implements Mobile.IDeviceApplicationManager
{
private lastInstalledAppIdentifiers: string[];
private lastAvailableDebuggableApps: Mobile.IDeviceApplicationInformation[];
private lastAvailableDebuggableAppViews: IDictionary<
Expand Down Expand Up @@ -36,7 +37,7 @@ export abstract class ApplicationManagerBase
appIdentifier
);

if (isApplicationInstalled) {
if (isApplicationInstalled && buildData?.clean) {
await this.uninstallApplication(appIdentifier);
}

Expand Down Expand Up @@ -65,7 +66,8 @@ export abstract class ApplicationManagerBase
// use locking, so the next executions will not get into the body, while the first one is still working.
// In case we do not break the next executions, we'll report each app as newly installed several times.
try {
const currentlyInstalledAppIdentifiers = await this.getInstalledApplications();
const currentlyInstalledAppIdentifiers =
await this.getInstalledApplications();
const previouslyInstalledAppIdentifiers =
this.lastInstalledAppIdentifiers || [];

Expand Down Expand Up @@ -122,9 +124,7 @@ export abstract class ApplicationManagerBase
appIdentifier?: string,
buildData?: IBuildData
): Promise<void>;
public abstract uninstallApplication(
appIdentifier: string
): Promise<void>;
public abstract uninstallApplication(appIdentifier: string): Promise<void>;
public abstract startApplication(
appData: Mobile.IApplicationData
): Promise<void>;
Expand Down Expand Up @@ -190,9 +190,8 @@ export abstract class ApplicationManagerBase
_.each(
currentlyAvailableAppViews,
(currentlyAvailableViews, appIdentifier) => {
const previouslyAvailableViews = this.lastAvailableDebuggableAppViews[
appIdentifier
];
const previouslyAvailableViews =
this.lastAvailableDebuggableAppViews[appIdentifier];

const newAvailableViews = _.differenceBy(
currentlyAvailableViews,
Expand Down Expand Up @@ -229,9 +228,8 @@ export abstract class ApplicationManagerBase
}
});

this.lastAvailableDebuggableAppViews[
appIdentifier
] = currentlyAvailableViews;
this.lastAvailableDebuggableAppViews[appIdentifier] =
currentlyAvailableViews;
}
);
}
Expand Down

0 comments on commit bac14c0

Please sign in to comment.