Skip to content

Commit bac14c0

Browse files
committed
feat: don't uninstall app by default
1 parent 9d2ec7c commit bac14c0

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

lib/common/mobile/application-manager-base.ts

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ import * as _ from "lodash";
66

77
export abstract class ApplicationManagerBase
88
extends EventEmitter
9-
implements Mobile.IDeviceApplicationManager {
9+
implements Mobile.IDeviceApplicationManager
10+
{
1011
private lastInstalledAppIdentifiers: string[];
1112
private lastAvailableDebuggableApps: Mobile.IDeviceApplicationInformation[];
1213
private lastAvailableDebuggableAppViews: IDictionary<
@@ -36,7 +37,7 @@ export abstract class ApplicationManagerBase
3637
appIdentifier
3738
);
3839

39-
if (isApplicationInstalled) {
40+
if (isApplicationInstalled && buildData?.clean) {
4041
await this.uninstallApplication(appIdentifier);
4142
}
4243

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

@@ -122,9 +124,7 @@ export abstract class ApplicationManagerBase
122124
appIdentifier?: string,
123125
buildData?: IBuildData
124126
): Promise<void>;
125-
public abstract uninstallApplication(
126-
appIdentifier: string
127-
): Promise<void>;
127+
public abstract uninstallApplication(appIdentifier: string): Promise<void>;
128128
public abstract startApplication(
129129
appData: Mobile.IApplicationData
130130
): Promise<void>;
@@ -190,9 +190,8 @@ export abstract class ApplicationManagerBase
190190
_.each(
191191
currentlyAvailableAppViews,
192192
(currentlyAvailableViews, appIdentifier) => {
193-
const previouslyAvailableViews = this.lastAvailableDebuggableAppViews[
194-
appIdentifier
195-
];
193+
const previouslyAvailableViews =
194+
this.lastAvailableDebuggableAppViews[appIdentifier];
196195

197196
const newAvailableViews = _.differenceBy(
198197
currentlyAvailableViews,
@@ -229,9 +228,8 @@ export abstract class ApplicationManagerBase
229228
}
230229
});
231230

232-
this.lastAvailableDebuggableAppViews[
233-
appIdentifier
234-
] = currentlyAvailableViews;
231+
this.lastAvailableDebuggableAppViews[appIdentifier] =
232+
currentlyAvailableViews;
235233
}
236234
);
237235
}

0 commit comments

Comments
 (0)