Added new -air-simulator option for lime test air -ios (or lime test air -android)
This launches the AIR simulator (ADL), but it passes additional options to tell it to simulate a mobile device.
This commit is contained in:
@@ -201,8 +201,10 @@ class AIRHelper
|
||||
|
||||
public static function run(project:HXProject, workingDirectory:String, targetPlatform:Platform, applicationXML:String, rootDirectory:String = null):Void
|
||||
{
|
||||
if (targetPlatform == ANDROID)
|
||||
var runInAdl = true;
|
||||
if (targetPlatform == ANDROID && !project.targetFlags.exists("air-simulator"))
|
||||
{
|
||||
runInAdl = false;
|
||||
AndroidHelper.initialize(project);
|
||||
AndroidHelper.install(project,
|
||||
FileSystem.fullPath(workingDirectory)
|
||||
@@ -212,8 +214,9 @@ class AIRHelper
|
||||
+ ".apk");
|
||||
AndroidHelper.run(project.meta.packageName + "/.AppEntry");
|
||||
}
|
||||
else if (targetPlatform == IOS)
|
||||
else if (targetPlatform == IOS && !project.targetFlags.exists("air-simulator"))
|
||||
{
|
||||
runInAdl = false;
|
||||
var args = ["-platform", "ios"];
|
||||
|
||||
if (project.targetFlags.exists("simulator"))
|
||||
@@ -249,14 +252,46 @@ class AIRHelper
|
||||
System.runCommand("", "open", [simulatorAppPath]);
|
||||
}
|
||||
}
|
||||
else
|
||||
if (runInAdl)
|
||||
{
|
||||
var extDirs:Array<String> = getExtDirs(project);
|
||||
|
||||
var profile:String = extDirs.length > 0 ? "extendedDesktop" : "desktop";
|
||||
var profile:String;
|
||||
if (targetPlatform == ANDROID)
|
||||
{
|
||||
profile = "mobileDevice";
|
||||
}
|
||||
else if (targetPlatform == IOS)
|
||||
{
|
||||
profile = "mobileDevice";
|
||||
}
|
||||
else
|
||||
{
|
||||
profile = extDirs.length > 0 ? "extendedDesktop" : "desktop";
|
||||
}
|
||||
|
||||
var args = ["-profile", profile];
|
||||
|
||||
if (targetPlatform == ANDROID || targetPlatform == IOS)
|
||||
{
|
||||
// these are just generic default dimensions that are a bit
|
||||
// larger than AIR's defaults for the simulator
|
||||
args.push("-XscreenDPI");
|
||||
args.push("252");
|
||||
args.push("-screensize");
|
||||
args.push("480x762:480x800");
|
||||
}
|
||||
if (targetPlatform == ANDROID)
|
||||
{
|
||||
args.push("-XversionPlatform");
|
||||
args.push("AND");
|
||||
}
|
||||
else if (targetPlatform == IOS)
|
||||
{
|
||||
args.push("-XversionPlatform");
|
||||
args.push("IOS");
|
||||
}
|
||||
|
||||
if (!project.debug)
|
||||
{
|
||||
args.push("-nodebug");
|
||||
@@ -290,7 +325,7 @@ class AIRHelper
|
||||
|
||||
public static function trace(project:HXProject, workingDirectory:String, targetPlatform:Platform, applicationXML:String, rootDirectory:String = null)
|
||||
{
|
||||
if (targetPlatform == ANDROID)
|
||||
if (targetPlatform == ANDROID && !project.targetFlags.exists("air-simulator"))
|
||||
{
|
||||
AndroidHelper.initialize(project);
|
||||
var deviceID = null;
|
||||
|
||||
@@ -1026,6 +1026,8 @@ class CommandLineTools
|
||||
Log.println(" \x1b[3m(flash)\x1b[0m \x1b[1m-web\x1b[0m -- Test Flash target using a web template");
|
||||
Log.println(" \x1b[3m(air)\x1b[0m \x1b[1m-ios\x1b[0m -- Target iOS instead of AIR desktop");
|
||||
Log.println(" \x1b[3m(air)\x1b[0m \x1b[1m-android\x1b[0m -- Target Android instead of AIR desktop");
|
||||
Log.println(" \x1b[3m(air)\x1b[0m \x1b[1m-ios -air-simulator\x1b[0m -- Target AIR simulator as iOS");
|
||||
Log.println(" \x1b[3m(air)\x1b[0m \x1b[1m-android -air-simulator\x1b[0m -- Target AIR simulator as Android");
|
||||
|
||||
if (command != "run" && command != "trace")
|
||||
{
|
||||
|
||||
@@ -68,7 +68,7 @@ class AIRPlatform extends FlashPlatform
|
||||
|
||||
// TODO: Should we package on desktop in "deploy" command instead?
|
||||
|
||||
if (targetPlatformType != DESKTOP)
|
||||
if (targetPlatformType != DESKTOP && !project.targetFlags.exists("air-simulator"))
|
||||
{
|
||||
var files = [project.app.file + ".swf"];
|
||||
for (asset in project.assets)
|
||||
|
||||
Reference in New Issue
Block a user