File tree 5 files changed +27
-0
lines changed
5 files changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -62,6 +62,9 @@ export class AppiumServer {
62
62
const device = await this . _deviceManager . startDevice ( this . _args ) ;
63
63
this . _args . device = device ;
64
64
}
65
+ if ( this . _args . isIOS ) {
66
+ this . _deviceManager . installApp ( this . _args ) ;
67
+ }
65
68
log ( "Starting server..." , this . _args . verbose ) ;
66
69
const logLevel = this . _args . verbose === true ? "debug" : "info" ;
67
70
this . port = port || this . _args . port ;
Original file line number Diff line number Diff line change @@ -8,6 +8,8 @@ export declare class DeviceManger implements IDeviceManager {
8
8
constructor ( port : any , _serveiceContext ?: ServiceContext ) ;
9
9
startDevice ( args : INsCapabilities ) : Promise < IDevice > ;
10
10
stopDevice ( args : INsCapabilities ) : Promise < any > ;
11
+ installApp ( args : INsCapabilities ) : Promise < any > ;
12
+ unInstallApp ( args : INsCapabilities ) : Promise < any > ;
11
13
static kill ( device : IDevice ) : Promise < void > ;
12
14
private static getDefaultDevice ( args ) ;
13
15
}
Original file line number Diff line number Diff line change @@ -20,6 +20,8 @@ import {
20
20
Status ,
21
21
DeviceType
22
22
} from "mobile-devices-controller" ;
23
+ import { IOSController } from "../../mobile-devices-controller/lib/ios-controller" ;
24
+ import { AndroidController } from "../../mobile-devices-controller/lib/android-controller" ;
23
25
24
26
25
27
export class DeviceManger implements IDeviceManager {
@@ -136,6 +138,22 @@ export class DeviceManger implements IDeviceManager {
136
138
}
137
139
}
138
140
141
+ public async installApp ( args : INsCapabilities ) : Promise < any > {
142
+ if ( args . isIOS ) {
143
+ IOSController . installApp ( args . device , args . appiumCaps . app ) ;
144
+ } else {
145
+ AndroidController . installApp ( args . device , args . appiumCaps . app )
146
+ }
147
+ }
148
+
149
+ public async unInstallApp ( args : INsCapabilities ) : Promise < any > {
150
+ if ( args . isIOS ) {
151
+ IOSController . uninstallApp ( args . device , args . appiumCaps . app ) ;
152
+ } else {
153
+ AndroidController . uninstallApp ( args . device , args . appiumCaps . app )
154
+ }
155
+ }
156
+
139
157
public static async kill ( device : IDevice ) {
140
158
await DeviceController . kill ( device ) ;
141
159
}
Original file line number Diff line number Diff line change @@ -3,4 +3,6 @@ import { IDevice } from "mobile-devices-controller";
3
3
export interface IDeviceManager {
4
4
startDevice ( args : INsCapabilities ) : Promise < IDevice > ;
5
5
stopDevice ( args : INsCapabilities ) : Promise < IDevice > ;
6
+ installApp ( args : INsCapabilities ) : Promise < void > ;
7
+ unInstallApp ( args : INsCapabilities ) : Promise < void > ;
6
8
}
Original file line number Diff line number Diff line change @@ -4,4 +4,6 @@ import { IDevice } from "mobile-devices-controller";
4
4
export interface IDeviceManager {
5
5
startDevice ( args : INsCapabilities ) : Promise < IDevice >
6
6
stopDevice ( args : INsCapabilities ) : Promise < IDevice >
7
+ installApp ( args : INsCapabilities ) : Promise < void > ;
8
+ unInstallApp ( args : INsCapabilities ) : Promise < void > ;
7
9
}
You can’t perform that action at this time.
0 commit comments