appium-android-driver 12.4.7 → 12.4.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/build/lib/commands/file-actions.d.ts +37 -19
- package/build/lib/commands/file-actions.d.ts.map +1 -1
- package/build/lib/commands/file-actions.js +44 -58
- package/build/lib/commands/file-actions.js.map +1 -1
- package/build/lib/commands/geolocation.d.ts +44 -36
- package/build/lib/commands/geolocation.d.ts.map +1 -1
- package/build/lib/commands/geolocation.js +38 -32
- package/build/lib/commands/geolocation.js.map +1 -1
- package/build/lib/commands/intent.d.ts +103 -107
- package/build/lib/commands/intent.d.ts.map +1 -1
- package/build/lib/commands/intent.js +103 -97
- package/build/lib/commands/intent.js.map +1 -1
- package/build/lib/commands/log.d.ts +44 -48
- package/build/lib/commands/log.d.ts.map +1 -1
- package/build/lib/commands/log.js +30 -54
- package/build/lib/commands/log.js.map +1 -1
- package/build/lib/commands/network.d.ts +59 -39
- package/build/lib/commands/network.d.ts.map +1 -1
- package/build/lib/commands/network.js +65 -45
- package/build/lib/commands/network.js.map +1 -1
- package/build/lib/commands/recordscreen.d.ts +25 -40
- package/build/lib/commands/recordscreen.d.ts.map +1 -1
- package/build/lib/commands/recordscreen.js +46 -63
- package/build/lib/commands/recordscreen.js.map +1 -1
- package/build/lib/commands/types.d.ts.map +1 -1
- package/build/lib/driver.d.ts +11 -10
- package/build/lib/driver.d.ts.map +1 -1
- package/build/lib/driver.js.map +1 -1
- package/lib/commands/{file-actions.js → file-actions.ts} +88 -74
- package/lib/commands/{geolocation.js → geolocation.ts} +85 -54
- package/lib/commands/intent.ts +422 -0
- package/lib/commands/{log.js → log.ts} +68 -73
- package/lib/commands/{network.js → network.ts} +106 -59
- package/lib/commands/{recordscreen.js → recordscreen.ts} +77 -73
- package/lib/commands/types.ts +17 -0
- package/lib/driver.ts +2 -1
- package/package.json +1 -1
- package/lib/commands/intent.js +0 -409
|
@@ -26,9 +26,10 @@ const app_management_1 = require("./app-management");
|
|
|
26
26
|
const GEO_EPSILON = Number.MIN_VALUE;
|
|
27
27
|
const MOCK_APP_IDS_STORE = '/data/local/tmp/mock_apps.json';
|
|
28
28
|
/**
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
* @
|
|
29
|
+
* Sets the device geolocation.
|
|
30
|
+
*
|
|
31
|
+
* @param location The geolocation object containing latitude, longitude, and altitude.
|
|
32
|
+
* @returns Promise that resolves to the current geolocation after setting it.
|
|
32
33
|
*/
|
|
33
34
|
async function setGeoLocation(location) {
|
|
34
35
|
await this.settingsApp.setGeoLocation(location, this.isEmulator());
|
|
@@ -36,7 +37,7 @@ async function setGeoLocation(location) {
|
|
|
36
37
|
return await this.getGeoLocation();
|
|
37
38
|
}
|
|
38
39
|
catch (e) {
|
|
39
|
-
this.log.warn(`Could not get the current geolocation info: ${
|
|
40
|
+
this.log.warn(`Could not get the current geolocation info: ${e.message}`);
|
|
40
41
|
this.log.warn(`Returning the default zero'ed values`);
|
|
41
42
|
return {
|
|
42
43
|
latitude: GEO_EPSILON,
|
|
@@ -48,16 +49,15 @@ async function setGeoLocation(location) {
|
|
|
48
49
|
/**
|
|
49
50
|
* Set the device geolocation.
|
|
50
51
|
*
|
|
51
|
-
* @
|
|
52
|
-
* @param
|
|
53
|
-
* @param
|
|
54
|
-
* @param
|
|
55
|
-
* @param
|
|
56
|
-
* @param {number} [speed] Valid speed value.
|
|
52
|
+
* @param latitude Valid latitude value.
|
|
53
|
+
* @param longitude Valid longitude value.
|
|
54
|
+
* @param altitude Valid altitude value.
|
|
55
|
+
* @param satellites Number of satellites being tracked (1-12). Available for emulators.
|
|
56
|
+
* @param speed Valid speed value.
|
|
57
57
|
* https://developer.android.com/reference/android/location/Location#setSpeed(float)
|
|
58
|
-
* @param
|
|
58
|
+
* @param bearing Valid bearing value. Available for real devices.
|
|
59
59
|
* https://developer.android.com/reference/android/location/Location#setBearing(float)
|
|
60
|
-
* @param
|
|
60
|
+
* @param accuracy Valid accuracy value. Available for real devices.
|
|
61
61
|
* https://developer.android.com/reference/android/location/Location#setAccuracy(float),
|
|
62
62
|
* https://developer.android.com/reference/android/location/Criteria
|
|
63
63
|
*/
|
|
@@ -69,7 +69,7 @@ async function mobileSetGeolocation(latitude, longitude, altitude, satellites, s
|
|
|
69
69
|
satellites,
|
|
70
70
|
speed,
|
|
71
71
|
bearing,
|
|
72
|
-
accuracy
|
|
72
|
+
accuracy,
|
|
73
73
|
}, this.isEmulator());
|
|
74
74
|
}
|
|
75
75
|
/**
|
|
@@ -79,19 +79,19 @@ async function mobileSetGeolocation(latitude, longitude, altitude, satellites, s
|
|
|
79
79
|
* installed. In case the vanilla LocationManager is used the device API level
|
|
80
80
|
* must be at version 30 (Android R) or higher.
|
|
81
81
|
*
|
|
82
|
-
* @
|
|
83
|
-
* @param {number} [timeoutMs] The maximum number of milliseconds
|
|
82
|
+
* @param timeoutMs The maximum number of milliseconds
|
|
84
83
|
* to block until GPS cache is refreshed. Providing zero or a negative
|
|
85
84
|
* value to it skips waiting completely.
|
|
86
85
|
* 20000ms by default.
|
|
87
|
-
* @returns
|
|
86
|
+
* @returns Promise that resolves when the GPS cache refresh is initiated.
|
|
88
87
|
*/
|
|
89
88
|
async function mobileRefreshGpsCache(timeoutMs) {
|
|
90
89
|
await this.settingsApp.refreshGeoLocationCache(timeoutMs);
|
|
91
90
|
}
|
|
92
91
|
/**
|
|
93
|
-
*
|
|
94
|
-
*
|
|
92
|
+
* Gets the current device geolocation.
|
|
93
|
+
*
|
|
94
|
+
* @returns Promise that resolves to the current geolocation object.
|
|
95
95
|
*/
|
|
96
96
|
async function getGeoLocation() {
|
|
97
97
|
const { latitude, longitude, altitude } = await this.settingsApp.getGeoLocation();
|
|
@@ -102,22 +102,25 @@ async function getGeoLocation() {
|
|
|
102
102
|
};
|
|
103
103
|
}
|
|
104
104
|
/**
|
|
105
|
-
*
|
|
106
|
-
*
|
|
105
|
+
* Gets the current device geolocation.
|
|
106
|
+
*
|
|
107
|
+
* @returns Promise that resolves to the current geolocation object.
|
|
107
108
|
*/
|
|
108
109
|
async function mobileGetGeolocation() {
|
|
109
110
|
return await this.getGeoLocation();
|
|
110
111
|
}
|
|
111
112
|
/**
|
|
112
|
-
*
|
|
113
|
-
*
|
|
113
|
+
* Checks if location services are enabled.
|
|
114
|
+
*
|
|
115
|
+
* @returns Promise that resolves to `true` if location services are enabled, `false` otherwise.
|
|
114
116
|
*/
|
|
115
117
|
async function isLocationServicesEnabled() {
|
|
116
118
|
return (await this.adb.getLocationProviders()).includes('gps');
|
|
117
119
|
}
|
|
118
120
|
/**
|
|
119
|
-
*
|
|
120
|
-
*
|
|
121
|
+
* Toggles the location services state.
|
|
122
|
+
*
|
|
123
|
+
* @returns Promise that resolves when the location services state is toggled.
|
|
121
124
|
*/
|
|
122
125
|
async function toggleLocationServices() {
|
|
123
126
|
this.log.info('Toggling location services');
|
|
@@ -127,8 +130,10 @@ async function toggleLocationServices() {
|
|
|
127
130
|
await this.adb.toggleGPSLocationProvider(!isGpsEnabled);
|
|
128
131
|
}
|
|
129
132
|
/**
|
|
130
|
-
*
|
|
131
|
-
*
|
|
133
|
+
* Resets the geolocation to the default state.
|
|
134
|
+
*
|
|
135
|
+
* @returns Promise that resolves when the geolocation is reset.
|
|
136
|
+
* @throws {Error} If called on an emulator (geolocation reset does not work on emulators).
|
|
132
137
|
*/
|
|
133
138
|
async function mobileResetGeolocation() {
|
|
134
139
|
if (this.isEmulator()) {
|
|
@@ -138,9 +143,10 @@ async function mobileResetGeolocation() {
|
|
|
138
143
|
}
|
|
139
144
|
// #region Internal helpers
|
|
140
145
|
/**
|
|
141
|
-
*
|
|
142
|
-
*
|
|
143
|
-
* @
|
|
146
|
+
* Sets the mock location permission for a specific app.
|
|
147
|
+
*
|
|
148
|
+
* @param appId The application package identifier.
|
|
149
|
+
* @returns Promise that resolves when the mock location permission is set.
|
|
144
150
|
*/
|
|
145
151
|
async function setMockLocationApp(appId) {
|
|
146
152
|
try {
|
|
@@ -151,7 +157,6 @@ async function setMockLocationApp(appId) {
|
|
|
151
157
|
return;
|
|
152
158
|
}
|
|
153
159
|
try {
|
|
154
|
-
/** @type {string[]} */
|
|
155
160
|
let pkgIds = [];
|
|
156
161
|
if (await this.adb.fileExists(MOCK_APP_IDS_STORE)) {
|
|
157
162
|
try {
|
|
@@ -178,8 +183,9 @@ async function setMockLocationApp(appId) {
|
|
|
178
183
|
}
|
|
179
184
|
}
|
|
180
185
|
/**
|
|
181
|
-
*
|
|
182
|
-
*
|
|
186
|
+
* Resets the mock location permissions for all apps.
|
|
187
|
+
*
|
|
188
|
+
* @returns Promise that resolves when the mock location permissions are reset.
|
|
183
189
|
*/
|
|
184
190
|
async function resetMockLocation() {
|
|
185
191
|
try {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"geolocation.js","sourceRoot":"","sources":["../../../lib/commands/geolocation.
|
|
1
|
+
{"version":3,"file":"geolocation.js","sourceRoot":"","sources":["../../../lib/commands/geolocation.ts"],"names":[],"mappings":";;;;;AAuBA,wCAkBC;AAiBD,oDAmBC;AAeD,sDAKC;AAOD,wCASC;AAOD,oDAIC;AAOD,8DAIC;AAOD,wDAUC;AAQD,wDAOC;AAUD,gDAgCC;AAjND,oDAAuB;AACvB,6CAA4C;AAC5C,0DAA6B;AAC7B,wDAAyB;AAEzB,2DAAsD;AACtD,qDAAuD;AAGvD,mDAAmD;AACnD,yEAAyE;AACzE,6DAA6D;AAC7D,0EAA0E;AAC1E,qHAAqH;AACrH,MAAM,WAAW,GAAG,MAAM,CAAC,SAAS,CAAC;AACrC,MAAM,kBAAkB,GAAG,gCAAgC,CAAC;AAE5D;;;;;GAKG;AACI,KAAK,UAAU,cAAc,CAElC,QAAkB;IAElB,MAAM,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC,QAAQ,EAAE,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC;IACnE,IAAI,CAAC;QACH,OAAO,MAAM,IAAI,CA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AAC;QACb,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,kCAAmC,GAAa,CAAC,OAAO,EAAE,CAAC,CAAC;IAC5E,CAAC;AACH,CAAC;AAED,8BAA8B"}
|
|
@@ -1,121 +1,117 @@
|
|
|
1
|
+
import type { AndroidDriver } from '../driver';
|
|
1
2
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* @
|
|
5
|
-
* @param
|
|
6
|
-
* @param
|
|
7
|
-
* @param
|
|
8
|
-
* @param
|
|
9
|
-
* @param
|
|
10
|
-
* @param
|
|
11
|
-
* @param
|
|
12
|
-
* @param
|
|
13
|
-
* @
|
|
3
|
+
* Starts an Android activity.
|
|
4
|
+
*
|
|
5
|
+
* @deprecated Use {@link mobileStartActivity} instead.
|
|
6
|
+
* @param appPackage The package name of the application to start.
|
|
7
|
+
* @param appActivity The activity name to start.
|
|
8
|
+
* @param appWaitPackage The package name to wait for. Defaults to `appPackage` if not provided.
|
|
9
|
+
* @param appWaitActivity The activity name to wait for. Defaults to `appActivity` if not provided.
|
|
10
|
+
* @param intentAction The intent action to use.
|
|
11
|
+
* @param intentCategory The intent category to use.
|
|
12
|
+
* @param intentFlags The intent flags to use.
|
|
13
|
+
* @param optionalIntentArguments Optional intent arguments.
|
|
14
|
+
* @param dontStopAppOnReset If `true`, does not stop the app on reset. If not provided, uses the capability value.
|
|
15
|
+
* @returns Promise that resolves when the activity is started.
|
|
14
16
|
*/
|
|
15
|
-
export function startActivity(this:
|
|
16
|
-
export class startActivity {
|
|
17
|
-
/**
|
|
18
|
-
* @deprecated
|
|
19
|
-
* @this {import('../driver').AndroidDriver}
|
|
20
|
-
* @param {string} appPackage
|
|
21
|
-
* @param {string} appActivity
|
|
22
|
-
* @param {string} [appWaitPackage]
|
|
23
|
-
* @param {string} [appWaitActivity]
|
|
24
|
-
* @param {string} [intentAction]
|
|
25
|
-
* @param {string} [intentCategory]
|
|
26
|
-
* @param {string} [intentFlags]
|
|
27
|
-
* @param {string} [optionalIntentArguments]
|
|
28
|
-
* @param {boolean} [dontStopAppOnReset]
|
|
29
|
-
* @returns {Promise<void>}
|
|
30
|
-
*/
|
|
31
|
-
constructor(this: import("../driver").AndroidDriver, appPackage: string, appActivity: string, appWaitPackage?: string, appWaitActivity?: string, intentAction?: string, intentCategory?: string, intentFlags?: string, optionalIntentArguments?: string, dontStopAppOnReset?: boolean);
|
|
32
|
-
_cachedActivityArgs: import("@appium/types").StringRecord;
|
|
33
|
-
}
|
|
17
|
+
export declare function startActivity(this: AndroidDriver, appPackage: string, appActivity: string, appWaitPackage?: string, appWaitActivity?: string, intentAction?: string, intentCategory?: string, intentFlags?: string, optionalIntentArguments?: string, dontStopAppOnReset?: boolean): Promise<void>;
|
|
34
18
|
/**
|
|
35
|
-
*
|
|
36
|
-
*
|
|
19
|
+
* Starts an Android activity using the activity manager.
|
|
20
|
+
*
|
|
21
|
+
* @param wait Set it to `true` if you want to block the method call
|
|
37
22
|
* until the activity manager's process returns the control to the system.
|
|
38
|
-
* false by default.
|
|
39
|
-
* @param
|
|
40
|
-
* app before starting the activity
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
* for more details on possible windowing modes (constants starting with
|
|
46
|
-
* `WINDOWING_MODE_`).
|
|
47
|
-
* @param {string | number} [activityType] The activity type to launch the activity as.
|
|
23
|
+
* `false` by default.
|
|
24
|
+
* @param stop Set it to `true` to force stop the target
|
|
25
|
+
* app before starting the activity. `false` by default.
|
|
26
|
+
* @param windowingMode The windowing mode to launch the activity into.
|
|
27
|
+
* Check https://android.googlesource.com/platform/frameworks/base/+/master/core/java/android/app/WindowConfiguration.java
|
|
28
|
+
* for more details on possible windowing modes (constants starting with `WINDOWING_MODE_`).
|
|
29
|
+
* @param activityType The activity type to launch the activity as.
|
|
48
30
|
* Check https://android.googlesource.com/platform/frameworks/base/+/master/core/java/android/app/WindowConfiguration.java
|
|
49
31
|
* for more details on possible activity types (constants starting with `ACTIVITY_TYPE_`).
|
|
50
|
-
* @param
|
|
51
|
-
* @param
|
|
52
|
-
* @param
|
|
53
|
-
*
|
|
54
|
-
* @param
|
|
55
|
-
* @param
|
|
56
|
-
* @param
|
|
57
|
-
* @param
|
|
58
|
-
* @param
|
|
59
|
-
* @param
|
|
60
|
-
* @param
|
|
61
|
-
* @param
|
|
62
|
-
*
|
|
32
|
+
* @param display The display identifier to launch the activity into.
|
|
33
|
+
* @param user The user ID for which the activity is started.
|
|
34
|
+
* @param intent The name of the activity intent to start, for example
|
|
35
|
+
* `com.some.package.name/.YourActivitySubClassName`.
|
|
36
|
+
* @param action Action name.
|
|
37
|
+
* @param pkg Package name.
|
|
38
|
+
* @param uri Unified resource identifier.
|
|
39
|
+
* @param mimeType Mime type.
|
|
40
|
+
* @param identifier Optional identifier.
|
|
41
|
+
* @param component Component name.
|
|
42
|
+
* @param categories One or more category names.
|
|
43
|
+
* @param extras Optional intent arguments. Must be represented as array of arrays,
|
|
44
|
+
* where each subarray item contains two or three string items: value type, key name and the value itself.
|
|
45
|
+
* See {@link IntentOpts} for supported value types.
|
|
46
|
+
* @param flags Intent startup-specific flags as a hexadecimal string.
|
|
47
|
+
* @returns Promise that resolves to the command output string.
|
|
63
48
|
*/
|
|
64
|
-
export function mobileStartActivity(this:
|
|
49
|
+
export declare function mobileStartActivity(this: AndroidDriver, wait?: boolean, stop?: boolean, windowingMode?: string | number, activityType?: string | number, display?: number | string, user?: string, intent?: string, action?: string, pkg?: string, uri?: string, mimeType?: string, identifier?: string, component?: string, categories?: string | string[], extras?: string[][], flags?: string): Promise<string>;
|
|
65
50
|
/**
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
* @param
|
|
71
|
-
*
|
|
72
|
-
* @param
|
|
73
|
-
*
|
|
74
|
-
* @param
|
|
75
|
-
* @param
|
|
76
|
-
* @param
|
|
77
|
-
* @param
|
|
78
|
-
* @param
|
|
79
|
-
* @param
|
|
80
|
-
* @param
|
|
81
|
-
* @param
|
|
82
|
-
*
|
|
51
|
+
* Sends a broadcast intent to the Android system.
|
|
52
|
+
*
|
|
53
|
+
* @param receiverPermission Require receiver to hold the given permission.
|
|
54
|
+
* @param allowBackgroundActivityStarts Whether the receiver may start activities even if in the background.
|
|
55
|
+
* @param user The user ID for which the broadcast is sent.
|
|
56
|
+
* The `current` alias assumes the current user ID. `all` by default.
|
|
57
|
+
* @param intent The name of the activity intent to broadcast, for example
|
|
58
|
+
* `com.some.package.name/.YourServiceSubClassName`.
|
|
59
|
+
* @param action Action name.
|
|
60
|
+
* @param pkg Package name.
|
|
61
|
+
* @param uri Unified resource identifier.
|
|
62
|
+
* @param mimeType Mime type.
|
|
63
|
+
* @param identifier Optional identifier.
|
|
64
|
+
* @param component Component name.
|
|
65
|
+
* @param categories One or more category names.
|
|
66
|
+
* @param extras Optional intent arguments. Must be represented as array of arrays,
|
|
67
|
+
* where each subarray item contains two or three string items: value type, key name and the value itself.
|
|
68
|
+
* See {@link IntentOpts} for supported value types.
|
|
69
|
+
* @param flags Intent startup-specific flags as a hexadecimal string.
|
|
70
|
+
* @returns Promise that resolves to the command output string.
|
|
83
71
|
*/
|
|
84
|
-
export function mobileBroadcast(this:
|
|
72
|
+
export declare function mobileBroadcast(this: AndroidDriver, receiverPermission?: string, allowBackgroundActivityStarts?: boolean, user?: string | number, intent?: string, action?: string, pkg?: string, uri?: string, mimeType?: string, identifier?: string, component?: string, categories?: string | string[], extras?: string[][], flags?: string): Promise<string>;
|
|
85
73
|
/**
|
|
86
|
-
*
|
|
87
|
-
*
|
|
88
|
-
*
|
|
89
|
-
*
|
|
90
|
-
* @param
|
|
91
|
-
*
|
|
92
|
-
* @param
|
|
93
|
-
*
|
|
94
|
-
* @param
|
|
95
|
-
* @param
|
|
96
|
-
* @param
|
|
97
|
-
* @param
|
|
98
|
-
* @param
|
|
99
|
-
* @param
|
|
100
|
-
* @param
|
|
101
|
-
* @
|
|
74
|
+
* Starts an Android service.
|
|
75
|
+
*
|
|
76
|
+
* @param foreground Set it to `true` if your service must be started as foreground service.
|
|
77
|
+
* This option is ignored if the API level of the device under test is below 26 (Android 8).
|
|
78
|
+
* @param user The user ID for which the service is started.
|
|
79
|
+
* The `current` user id is used by default.
|
|
80
|
+
* @param intent The name of the activity intent to start, for example
|
|
81
|
+
* `com.some.package.name/.YourServiceSubClassName`.
|
|
82
|
+
* @param action Action name.
|
|
83
|
+
* @param pkg Package name.
|
|
84
|
+
* @param uri Unified resource identifier.
|
|
85
|
+
* @param mimeType Mime type.
|
|
86
|
+
* @param identifier Optional identifier.
|
|
87
|
+
* @param component Component name.
|
|
88
|
+
* @param categories One or more category names.
|
|
89
|
+
* @param extras Optional intent arguments. Must be represented as array of arrays,
|
|
90
|
+
* where each subarray item contains two or three string items: value type, key name and the value itself.
|
|
91
|
+
* See {@link IntentOpts} for supported value types.
|
|
92
|
+
* @param flags Intent startup-specific flags as a hexadecimal string.
|
|
93
|
+
* @returns Promise that resolves to the command output string.
|
|
102
94
|
*/
|
|
103
|
-
export function mobileStartService(this:
|
|
95
|
+
export declare function mobileStartService(this: AndroidDriver, foreground?: boolean, user?: string, intent?: string, action?: string, pkg?: string, uri?: string, mimeType?: string, identifier?: string, component?: string, categories?: string | string[], extras?: string[][], flags?: string): Promise<string>;
|
|
104
96
|
/**
|
|
105
|
-
*
|
|
106
|
-
*
|
|
107
|
-
* @param
|
|
108
|
-
* @param
|
|
109
|
-
*
|
|
110
|
-
* @param
|
|
111
|
-
* @param
|
|
112
|
-
* @param
|
|
113
|
-
* @param
|
|
114
|
-
* @param
|
|
115
|
-
* @param
|
|
116
|
-
* @param
|
|
117
|
-
* @
|
|
97
|
+
* Stops an Android service.
|
|
98
|
+
*
|
|
99
|
+
* @param user The user ID for which the service is stopped.
|
|
100
|
+
* @param intent The name of the activity intent to stop, for example
|
|
101
|
+
* `com.some.package.name/.YourServiceSubClassName`.
|
|
102
|
+
* @param action Action name.
|
|
103
|
+
* @param pkg Package name.
|
|
104
|
+
* @param uri Unified resource identifier.
|
|
105
|
+
* @param mimeType Mime type.
|
|
106
|
+
* @param identifier Optional identifier.
|
|
107
|
+
* @param component Component name.
|
|
108
|
+
* @param categories One or more category names.
|
|
109
|
+
* @param extras Optional intent arguments. Must be represented as array of arrays,
|
|
110
|
+
* where each subarray item contains two or three string items: value type, key name and the value itself.
|
|
111
|
+
* See {@link IntentOpts} for supported value types.
|
|
112
|
+
* @param flags Intent startup-specific flags as a hexadecimal string.
|
|
113
|
+
* @returns Promise that resolves to the command output string.
|
|
114
|
+
* If the service was already stopped, returns the error message.
|
|
118
115
|
*/
|
|
119
|
-
export function mobileStopService(this:
|
|
120
|
-
export type ADB = import("appium-adb").ADB;
|
|
116
|
+
export declare function mobileStopService(this: AndroidDriver, user?: string, intent?: string, action?: string, pkg?: string, uri?: string, mimeType?: string, identifier?: string, component?: string, categories?: string | string[], extras?: string[][], flags?: string): Promise<string>;
|
|
121
117
|
//# sourceMappingURL=intent.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"intent.d.ts","sourceRoot":"","sources":["../../../lib/commands/intent.
|
|
1
|
+
{"version":3,"file":"intent.d.ts","sourceRoot":"","sources":["../../../lib/commands/intent.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,WAAW,CAAC;AAuB7C;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,aAAa,CACjC,IAAI,EAAE,aAAa,EACnB,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,MAAM,EACnB,cAAc,CAAC,EAAE,MAAM,EACvB,eAAe,CAAC,EAAE,MAAM,EACxB,YAAY,CAAC,EAAE,MAAM,EACrB,cAAc,CAAC,EAAE,MAAM,EACvB,WAAW,CAAC,EAAE,MAAM,EACpB,uBAAuB,CAAC,EAAE,MAAM,EAChC,kBAAkB,CAAC,EAAE,OAAO,GAC3B,OAAO,CAAC,IAAI,CAAC,CAuBf;AAED;;;;;;;;;;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