launch.json fields for SWF debugging - BowlerHatLLC/vscode-as3mxml Wiki

The ActionScript & MXML extension for Visual Studio Code provides a debugger for SWF files, which allows you to debug an application running in either Adobe AIR or Flash Player. In the case of mobile Adobe AIR apps, you can either debug in the simulator running on your computer or you can connect the debugger to an AIR app running on a mobile device.

Several custom configuration options are available when debugging SWFs. These options may be specified in addition to the standard options available in Visual Studio Code's launch.json file.

Table of Contents

Examples

The following launch configurations are provided by default:

{
	"version": "0.2.0",
	"configurations": [
		{
			"type": "swf",
			"request": "launch",
			"name": "Launch SWF"
		},
		{
			"type": "swf",
			"request": "attach",
			"name": "Attach SWF"
		}
	]
}

The "launch" request will launch your application in Adobe AIR or Flash Player, depending on your type of project. You don't need to specify the location of the SWF because the debugger will find it automatically in your asconfig.json project file.

The "attach" request allows you to launch an application manually before connecting the debugger, or it may be used to debug an application running on a mobile device. For mobile debugging, see the platform field below for details.

Launch Request Properties

The following optional properties may be specified on a "launch" request.

args

Custom command line arguments to pass to a desktop Adobe AIR application.

{
	"type": "swf",
	"request": "launch",
	"name": "Launch SWF",
	"args": [
		"-custom-arg=hello"
		"-another"
	]
}

See AIR application invocation and termination: Capturing command line arguments and flash.events.InvokeEvent for more details.

extdir

(Advanced) The directory where your application's unpackaged native extensions are located. In many cases, this field can be omitted because it will be populated with the appropriate value automatically.

{
	"type": "swf",
	"request": "launch",
	"name": "Launch SWF",
	"extdir": "path/to/unpackaged_anes"
}

Unpackaged native extensions are ANE files that have been unzipped for development. Each unpackaged native extension should appear in its own separate subdirectory of the location that you pass to the extdir field in launch.json.

For more details about unpackaged native extensions, find the documentation for -extdir in Building Adobe AIR Applications: AIR Debug Launcher (ADL).

Note: This field is used for debugging in the Adobe AIR simulator only. When packaging your Adobe AIR application to deploy to devices or app stores, use the extdir field in asconfig.json with the packaged ANEs instead.

profile

The Adobe AIR application profile to simulate.

{
	"type": "swf",
	"request": "launch",
	"name": "Launch SWF",
	"profile": "mobileDevice"
}

The following profile values are supported:

program

(Advanced) Custom path to a SWF, an AIR application descriptor, or an HTML file to launch. In many cases, this field can be omitted because it will be populated with the appropriate value automatically.

{
	"type": "swf",
	"request": "launch",
	"name": "Launch SWF",
	"program": "bin-debug/MyProject.swf"
}

runtimeExecutable

(Advanced) Path to runtime executable, such as the standalone version of Adobe Flash Player, a web browser, or AIR Debug Launcher. In many cases, this field can be omitted because it will be populated with the appropriate value automatically.

In the following example, an HTML file with an embedded SWF is launched in a web browser on Windows:

{
	"type": "swf",
	"request": "launch",
	"name": "Launch SWF",
	"program": "bin-debug/index.html",
	"runtimeExecutable": "c:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe"
}

In the next example, the standalone Flash Player is launched on macOS:

{
	"type": "swf",
	"request": "launch",
	"name": "Launch SWF",
	"runtimeExecutable": "/Applications/Flash Player.app"
}

runtimeArgs

(Advanced) Optional arguments to pass to the runtime executable, such as the standalone version of Adobe Flash Player, a web browser, or AIR Debug Launcher.

{
	"type": "swf",
	"request": "launch",
	"name": "Launch SWF",
	"runtimeArgs": "-custom-arg=hello -another"
}

To pass arguments to an Adobe AIR application that you're launching, use args instead.

screenDPI

📱 This property is available for mobile applications only.

The screen density (sometimes called DPI or PPI) of the mobile device to simulate. Customizes the value returned by flash.system.Capabilities.screenDPI. Typically used in combination with screensize.

{
	"type": "swf",
	"request": "launch",
	"name": "Launch SWF",
	"screenDPI": 326
}

screensize

📱 This property is available for mobile applications only.

The normal and full-screen dimensions of the simulated mobile device. Typically used in combination with screenDPI.

{
	"type": "swf",
	"request": "launch",
	"name": "Launch SWF",
	"screensize": "480x762:480x800"
}

A number of special screensize values with predefined resolutions are available, including "iPhone", "iPhoneRetina", and "iPad". See Building Adobe AIR Applications: AIR Debug Launcher (ADL) for a complete list.

versionPlatform

The platform string to simulate in the AIR Debug Launcher. Customizes the value returned by flash.system.Capabilities.version.

{
	"type": "swf",
	"request": "launch",
	"name": "Launch SWF",
	"versionPlatform": "IOS"
}

The following versionPlatform values are supported:

Attach Request Properties

The following optional properties may be specified on an "attach" request.

connect

📱 This property is available for mobile applications only.

By default, the debugger will listen for connections over wifi. If the "connect" property is true, the debugger will try to connect to the runtime over USB instead.

{
	"type": "swf",
	"request": "attach",
	"name": "Attach SWF",
	"connect": true,
	"platform": "android"
}

When setting the connect field to true in launch.json, you must also set the listen field to true in the airOptions section of asconfig.json. For more details, see asconfig.json Android options or asconfig.json iOS options.

port

📱 This property is available for mobile applications only.

(Advanced) If the "connect" property is true, the debugger will connect on the specified port.

{
	"type": "swf",
	"request": "attach",
	"name": "Attach SWF",
	"connect": true,
	"port": 12345
}

platform

📱 This property is available for mobile applications only.

Before connecting the debugger, the application will be installed over USB on a mobile device running the specified platform.

{
	"type": "swf",
	"request": "attach",
	"name": "Attach SWF",
	"platform": "ios"
}

The following platform values are supported:

Further Reading