@@ -6,7 +6,8 @@ import * as _ from "lodash";
6
6
7
7
export abstract class ApplicationManagerBase
8
8
extends EventEmitter
9
- implements Mobile . IDeviceApplicationManager {
9
+ implements Mobile . IDeviceApplicationManager
10
+ {
10
11
private lastInstalledAppIdentifiers : string [ ] ;
11
12
private lastAvailableDebuggableApps : Mobile . IDeviceApplicationInformation [ ] ;
12
13
private lastAvailableDebuggableAppViews : IDictionary <
@@ -36,7 +37,7 @@ export abstract class ApplicationManagerBase
36
37
appIdentifier
37
38
) ;
38
39
39
- if ( isApplicationInstalled ) {
40
+ if ( isApplicationInstalled && buildData ?. clean ) {
40
41
await this . uninstallApplication ( appIdentifier ) ;
41
42
}
42
43
@@ -65,7 +66,8 @@ export abstract class ApplicationManagerBase
65
66
// use locking, so the next executions will not get into the body, while the first one is still working.
66
67
// In case we do not break the next executions, we'll report each app as newly installed several times.
67
68
try {
68
- const currentlyInstalledAppIdentifiers = await this . getInstalledApplications ( ) ;
69
+ const currentlyInstalledAppIdentifiers =
70
+ await this . getInstalledApplications ( ) ;
69
71
const previouslyInstalledAppIdentifiers =
70
72
this . lastInstalledAppIdentifiers || [ ] ;
71
73
@@ -122,9 +124,7 @@ export abstract class ApplicationManagerBase
122
124
appIdentifier ?: string ,
123
125
buildData ?: IBuildData
124
126
) : Promise < void > ;
125
- public abstract uninstallApplication (
126
- appIdentifier : string
127
- ) : Promise < void > ;
127
+ public abstract uninstallApplication ( appIdentifier : string ) : Promise < void > ;
128
128
public abstract startApplication (
129
129
appData : Mobile . IApplicationData
130
130
) : Promise < void > ;
@@ -190,9 +190,8 @@ export abstract class ApplicationManagerBase
190
190
_ . each (
191
191
currentlyAvailableAppViews ,
192
192
( currentlyAvailableViews , appIdentifier ) => {
193
- const previouslyAvailableViews = this . lastAvailableDebuggableAppViews [
194
- appIdentifier
195
- ] ;
193
+ const previouslyAvailableViews =
194
+ this . lastAvailableDebuggableAppViews [ appIdentifier ] ;
196
195
197
196
const newAvailableViews = _ . differenceBy (
198
197
currentlyAvailableViews ,
@@ -229,9 +228,8 @@ export abstract class ApplicationManagerBase
229
228
}
230
229
} ) ;
231
230
232
- this . lastAvailableDebuggableAppViews [
233
- appIdentifier
234
- ] = currentlyAvailableViews ;
231
+ this . lastAvailableDebuggableAppViews [ appIdentifier ] =
232
+ currentlyAvailableViews ;
235
233
}
236
234
) ;
237
235
}
0 commit comments