Skip to content

Commit 65e6372

Browse files
fix: handle cloud sessions gracefully (#38)
* fix: handle cloud sessions gracefully * Update package.json * Update package-lock.json
1 parent 25ce153 commit 65e6372

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "appium-interceptor",
3-
"version": "1.0.0-beta.9",
3+
"version": "1.0.0-beta.10",
44
"description": "Appium 2.0 plugin to mock api calls for android apps",
55
"main": "./lib/index.js",
66
"types": "./lib/types/index.d.ts",

src/plugin.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,10 @@ export class AppiumInterceptorPlugin extends BasePlugin {
6868
const adb = driver.sessions[sessionId]?.adb;
6969

7070
if (interceptFlag && platformName.toLowerCase().trim() === 'android') {
71+
if(!adb) {
72+
log.info(`Unable to find adb instance from session ${sessionId}. So skipping api interception.`);
73+
return response;
74+
}
7175
const realDevice = await isRealDevice(adb, deviceUDID);
7276
const proxy = await setupProxyServer(sessionId, deviceUDID, realDevice);
7377
await configureWifiProxy(adb, deviceUDID, realDevice, proxy);

0 commit comments

Comments
 (0)