diff --git a/detox/src/devices/AndroidDriver.js b/detox/src/devices/AndroidDriver.js index d629f93960..c139a59e07 100644 --- a/detox/src/devices/AndroidDriver.js +++ b/detox/src/devices/AndroidDriver.js @@ -1,5 +1,4 @@ const {spawn} = require('child_process'); -const path = require('path'); const fs = require('fs'); const _ = require('lodash'); const log = require('npmlog'); @@ -15,16 +14,19 @@ const EspressoDetox = 'com.wix.detox.espresso.EspressoDetox'; class AndroidDriver extends DeviceDriverBase { constructor(client) { super(client); - const expect = require('../android/expect'); - expect.exportGlobals(); + this.expect = require('../android/expect'); this.invocationManager = new InvocationManager(client); - expect.setInvocationManager(this.invocationManager); + this.expect.setInvocationManager(this.invocationManager); this.adb = new ADB(); this.aapt = new AAPT(); this.apkPath = new APKPath(); } + exportGlobals() { + this.expect.exportGlobals(); + } + async getBundleIdFromBinary(apkPath) { return await this.aapt.getPackageName(apkPath); }