From f81fa3fc1bf5842bdb9f3d0c58c8a1a9b06d7609 Mon Sep 17 00:00:00 2001 From: Joshua Granick Date: Tue, 26 Sep 2017 11:43:55 -0700 Subject: [PATCH] Improvements to AIR mobile options --- lime/tools/helpers/AIRHelper.hx | 54 ++++------------------------- lime/tools/helpers/AndroidHelper.hx | 8 ++--- lime/tools/platforms/AIRPlatform.hx | 26 +++----------- 3 files changed, 12 insertions(+), 76 deletions(-) diff --git a/lime/tools/helpers/AIRHelper.hx b/lime/tools/helpers/AIRHelper.hx index 2a0f3ea71..418eef4b9 100644 --- a/lime/tools/helpers/AIRHelper.hx +++ b/lime/tools/helpers/AIRHelper.hx @@ -20,7 +20,7 @@ class AIRHelper { case MAC: - // extension = ".app"; + extension = ".app"; case IOS: @@ -50,7 +50,7 @@ class AIRHelper { } - // extension = ".ipa"; + extension = ".ipa"; case ANDROID: @@ -64,7 +64,7 @@ class AIRHelper { } - // extension = ".apk"; + extension = ".apk"; default: @@ -187,8 +187,8 @@ class AIRHelper { if (targetPlatform == ANDROID) { AndroidHelper.initialize (project); - AndroidHelper.install (project, FileSystem.fullPath (workingDirectory) + "/" + (rootDirectory != null ? rootDirectory + "/" : "") + project.app.file + ".apk"); - AndroidHelper.run (project.meta.packageName + "/.AppEntry"); + AndroidHelper.install (project, FileSystem.fullPath (workingDirectory) + "/" + project.app.file + ".apk"); + AndroidHelper.run ("air." + project.meta.packageName + "/.AppEntry"); } else if (targetPlatform == IOS) { @@ -206,7 +206,7 @@ class AIRHelper { } ProcessHelper.runCommand (workingDirectory, project.defines.get ("AIR_SDK") + "/bin/adt", [ "-uninstallApp" ].concat (args).concat ([ "-appid", project.meta.packageName ])); - ProcessHelper.runCommand (workingDirectory, project.defines.get ("AIR_SDK") + "/bin/adt", [ "-installApp" ].concat (args).concat ([ "-package", FileSystem.fullPath (workingDirectory) + "/" + (rootDirectory != null ? rootDirectory + "/" : "") + project.app.file + ".ipa" ])); + ProcessHelper.runCommand (workingDirectory, project.defines.get ("AIR_SDK") + "/bin/adt", [ "-installApp" ].concat (args).concat ([ "-package", FileSystem.fullPath (workingDirectory) + "/" + project.app.file + ".ipa" ])); if (project.targetFlags.exists ("simulator")) { @@ -239,46 +239,4 @@ class AIRHelper { } - public static function trace (project:HXProject, workingDirectory:String, targetPlatform:Platform, applicationXML:String, rootDirectory:String = null) { - - if (targetPlatform == ANDROID) { - - AndroidHelper.initialize (project); - var deviceID = null; - var adbFilter = null; - - // if (!LogHelper.verbose) { - - if (project.debug) { - - adbFilter = project.meta.packageName + ":I ActivityManager:I *:S"; - - } else { - - adbFilter = project.meta.packageName + ":I *:S"; - - } - - // } - - AndroidHelper.trace (project, project.debug, deviceID, adbFilter); - - } - - } - - - public static function uninstall (project:HXProject, workingDirectory:String, targetPlatform:Platform, applicationXML:String, rootDirectory:String = null) { - - if (targetPlatform == ANDROID) { - - AndroidHelper.initialize (project); - var deviceID = null; - AndroidHelper.uninstall (project.meta.packageName, deviceID); - - } - - } - - } \ No newline at end of file diff --git a/lime/tools/helpers/AndroidHelper.hx b/lime/tools/helpers/AndroidHelper.hx index 011b2646e..11923757a 100644 --- a/lime/tools/helpers/AndroidHelper.hx +++ b/lime/tools/helpers/AndroidHelper.hx @@ -403,7 +403,7 @@ class AndroidHelper { } - public static function trace (project:HXProject, debug:Bool, deviceID:String = null, customFilter:String = null):Void { + public static function trace (project:HXProject, debug:Bool, deviceID:String = null):Void { // Use -DFULL_LOGCAT or if you do not want to filter log messages @@ -418,11 +418,7 @@ class AndroidHelper { } - if (customFilter != null) { - - ProcessHelper.runCommand (adbPath, adbName, args.concat ([ customFilter ])); - - } else if (project.environment.exists("FULL_LOGCAT") || LogHelper.verbose) { + if (project.environment.exists("FULL_LOGCAT") || LogHelper.verbose) { ProcessHelper.runCommand (adbPath, adbName, args.concat ([ "-c" ])); ProcessHelper.runCommand (adbPath, adbName, args); diff --git a/lime/tools/platforms/AIRPlatform.hx b/lime/tools/platforms/AIRPlatform.hx index f2834716f..d986b58ab 100644 --- a/lime/tools/platforms/AIRPlatform.hx +++ b/lime/tools/platforms/AIRPlatform.hx @@ -103,7 +103,7 @@ class AIRPlatform extends FlashPlatform { } - AIRHelper.build (project, targetDirectory, targetPlatform, targetPath, "application.xml", files, "bin"); + AIRHelper.build (project, targetDirectory, targetPlatform, "bin/" + project.app.file + ".air", "application.xml", files, "bin"); } @@ -180,13 +180,6 @@ class AIRPlatform extends FlashPlatform { } - public override function install ():Void { - - // TODO: Make separate install step - - } - - public override function run ():Void { AIRHelper.run (project, targetDirectory, targetPlatform, "application.xml", "bin"); @@ -194,20 +187,6 @@ class AIRPlatform extends FlashPlatform { } - public override function trace ():Void { - - AIRHelper.trace (project, targetDirectory, targetPlatform, "application.xml", "bin"); - - } - - - public override function uninstall ():Void { - - AIRHelper.uninstall (project, targetDirectory, targetPlatform, "application.xml", "bin"); - - } - - public override function update ():Void { var destination = targetDirectory + "/bin/"; @@ -332,7 +311,10 @@ class AIRPlatform extends FlashPlatform { } + @ignore public override function install ():Void {} @ignore public override function rebuild ():Void {} + @ignore public override function trace ():Void {} + @ignore public override function uninstall ():Void {} } \ No newline at end of file