diff options
author | Juan Linietsky <reduzio@gmail.com> | 2016-01-20 00:29:34 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2016-01-20 00:29:34 -0300 |
commit | c9580965ea6577071fa84c9f064aa22ffa7ca920 (patch) | |
tree | 37051522dc40fdbd024b735a5658d478dda33a99 /platform/android/export | |
parent | 891e31b139b269fb154d30b8c7d7887267708d8b (diff) |
-Remote deploy now uses FS over USB on Android, super fast!
Diffstat (limited to 'platform/android/export')
-rw-r--r-- | platform/android/export/export.cpp | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/platform/android/export/export.cpp b/platform/android/export/export.cpp index c908f6729b..40b125e391 100644 --- a/platform/android/export/export.cpp +++ b/platform/android/export/export.cpp @@ -1513,6 +1513,13 @@ Error EditorExportPlatformAndroid::run(int p_device, int p_flags) { //export_temp ep.step("Exporting APK",0); + + bool use_adb_over_usb = bool(EDITOR_DEF("android/use_remote_debug_over_adb",true)); + + if (use_adb_over_usb) { + p_flags|=EXPORT_REMOTE_DEBUG_LOCALHOST; + } + String export_to=EditorSettings::get_singleton()->get_settings_path()+"/tmp/tmpexport.apk"; Error err = export_project(export_to,true,p_flags); if (err) { @@ -1559,6 +1566,35 @@ Error EditorExportPlatformAndroid::run(int p_device, int p_flags) { return ERR_CANT_CREATE; } + if (use_adb_over_usb) { + + args.clear(); + args.push_back("reverse"); + args.push_back("--remove-all"); + err = OS::get_singleton()->execute(adb,args,true,NULL,NULL,&rv); + + int port = Globals::get_singleton()->get("debug/debug_port"); + args.clear(); + args.push_back("reverse"); + args.push_back("tcp:"+itos(port)); + args.push_back("tcp:"+itos(port)); + + err = OS::get_singleton()->execute(adb,args,true,NULL,NULL,&rv); + print_line("Reverse result: "+itos(rv)); + + int fs_port = EditorSettings::get_singleton()->get("file_server/port"); + + args.clear(); + args.push_back("reverse"); + args.push_back("tcp:"+itos(fs_port)); + args.push_back("tcp:"+itos(fs_port)); + + err = OS::get_singleton()->execute(adb,args,true,NULL,NULL,&rv); + print_line("Reverse result2: "+itos(rv)); + + } + + ep.step("Running on Device..",3); args.clear(); args.push_back("-s"); @@ -1724,6 +1760,7 @@ void register_android_exporter() { //EDITOR_DEF("android/release_username",""); //EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::STRING,"android/release_keystore",PROPERTY_HINT_GLOBAL_FILE,"*.keystore")); EDITOR_DEF("android/timestamping_authority_url",""); + EDITOR_DEF("android/use_remote_debug_over_adb",false); Ref<EditorExportPlatformAndroid> exporter = Ref<EditorExportPlatformAndroid>( memnew(EditorExportPlatformAndroid) ); EditorImportExport::get_singleton()->add_export_platform(exporter); |