diff --git a/testing/mochitest/mach_commands.py b/testing/mochitest/mach_commands.py index 07b9fc1b48fb..994431c1b702 100644 --- a/testing/mochitest/mach_commands.py +++ b/testing/mochitest/mach_commands.py @@ -432,11 +432,6 @@ class RobocopCommands(MachCommandBase): kwargs['robocopIni'] = os.path.join(self.topobjdir, '_tests', 'testing', 'mochitest', 'robocop.ini') - if not kwargs.get('robocopApk'): - kwargs['robocopApk'] = os.path.join(self.topobjdir, 'mobile', 'android', - 'tests', 'browser', 'robocop', - 'robocop-debug.apk') - from mozbuild.controller.building import BuildDriver self._ensure_state_subdir_exists('.') diff --git a/testing/mochitest/mochitest_options.py b/testing/mochitest/mochitest_options.py index 9345e7b45a9a..d1d6632cb4e1 100644 --- a/testing/mochitest/mochitest_options.py +++ b/testing/mochitest/mochitest_options.py @@ -1026,9 +1026,15 @@ class AndroidArguments(ArgumentContainer): options.robocopIni = os.path.abspath(options.robocopIni) if not options.robocopApk and build_obj: - options.robocopApk = os.path.join(build_obj.topobjdir, 'mobile', 'android', - 'tests', 'browser', - 'robocop', 'robocop-debug.apk') + if build_obj.substs.get('MOZ_BUILD_MOBILE_ANDROID_WITH_GRADLE'): + options.robocopApk = os.path.join(build_obj.topobjdir, 'gradle', 'build', + 'mobile', 'android', 'app', 'outputs', 'apk', + 'app-automation-debug-androidTest-' + 'unaligned.apk') + else: + options.robocopApk = os.path.join(build_obj.topobjdir, 'mobile', 'android', + 'tests', 'browser', + 'robocop', 'robocop-debug.apk') if options.robocopApk != "": if not os.path.exists(options.robocopApk):