diff --git a/plugins/plugin_compile/build_android.py b/plugins/plugin_compile/build_android.py index 926d3850..2523f066 100755 --- a/plugins/plugin_compile/build_android.py +++ b/plugins/plugin_compile/build_android.py @@ -560,7 +560,9 @@ def do_build_apk(self, mode, no_apk, no_sign, output_dir, custom_step_args, andr self.gradle_build_apk(mode, android_platform, compile_obj, bundle) # copy the apk to output dir - if output_dir: + if bundle: + return + elif output_dir: # support generate unsigned apk if mode == "release" and no_sign: apk_name = '%s-%s-unsigned.apk' % (project_name, mode) diff --git a/plugins/plugin_deploy.py b/plugins/plugin_deploy.py index 63bb7f0c..7f28514f 100644 --- a/plugins/plugin_deploy.py +++ b/plugins/plugin_deploy.py @@ -154,6 +154,8 @@ def deploy_android(self, dependencies): cocos.Logging.info(MultiLanguage.get_string('DEPLOY_INFO_INSTALLING_APK')) compile_dep = dependencies['compile'] + if compile_dep._bundle: + return self.package = compile_dep.android_package self.activity = compile_dep.android_activity apk_path = compile_dep.apk_path diff --git a/plugins/plugin_run/project_run.py b/plugins/plugin_run/project_run.py index 706fb45b..61abe02b 100644 --- a/plugins/plugin_run/project_run.py +++ b/plugins/plugin_run/project_run.py @@ -221,12 +221,12 @@ def run_mac(self, dependencies): self._run_with_desktop_options(launch_macapp) def run_android_device(self, dependencies): - if not self._platforms.is_android_active(): + deploy_dep = dependencies['deploy'] + if not self._platforms.is_android_active() or not hasattr(deploy_dep, 'package'): return sdk_root = cocos.check_environment_variable('ANDROID_SDK_ROOT') adb_path = cocos.CMDRunner.convert_path_to_cmd(os.path.join(sdk_root, 'platform-tools', 'adb')) - deploy_dep = dependencies['deploy'] startapp = "%s shell am start -n \"%s/%s\"" % (adb_path, deploy_dep.package, deploy_dep.activity) self._run_cmd(startapp) pass