Skip to main content

Live Preview and debugging

Live Preview runs the project in a browser with live updates. Use it to exercise navigation, actions, data bindings, and feedback while editing in VS Code. The design canvas is for selecting and configuring controls; runtime interactions belong in the running preview.

This guide has an AVstudio Editor NG 27.0.29 baseline, with release-specific additions through 27.0.42. It covers preview startup, device sizes, development logging, and the bundled AVStudio DevTools panel. See the Changelog for release changes and verification scope.

Start preview​

  1. Open the workspace containing AVstudio UI and save your changes, including open action forms.
  2. Run Run Project Health Check and address missing files or broken references in Problems.
  3. Open the Command Palette with ⇧⌘P / Ctrl+Shift+P.
  4. Run AVstudio: Open Live Preview (Browser).
  5. Read the startup notification or Output → AVStudio Live Preview for the URL.

Open Live Preview command above the selected button and its Element Properties sidebar in VS Code

In 27.0.29, the local Live Preview/Custom Elements server starts from avstudio.liveServer.port (default 43981), tries the next two ports if busy, then falls back to an OS-assigned port. The preview command launches Chrome with a dedicated profile. Use the reported address; do not assume a fixed port or reuse a URL from an old session.

Open a specific page​

From 27.0.42, right-click a .page file under the project's pages/ folder in Explorer and select Open in Live Preview. The command opens that exact page. You can also activate the page editor and run AVstudio: Open in Live Preview from the Command Palette; without an Explorer file argument, it uses the active page.

Use Open Live Preview (Browser) for the normal preview entry point, or Open in Live Preview when testing a particular page. These are separate commands; opening a specific page does not require changing the project's start-page setting.

Find the preview URL​

Open VS Code's Output panel and select AVStudio Live Preview from the channel dropdown. The startup lines show the Local URL and, when a LAN address is available, the Network URL.

AVStudio Live Preview Output channel showing the started server and Local and Network URLs

The addresses in this screenshot are examples from the documentation session. Copy the addresses reported in your own workspace. If the notification disappears, the Output channel remains the place to check the startup information.

AddressWhere to use it
Local, such as http://127.0.0.1:<port>A browser on the development computer.
Network, with the development computer's LAN addressA reachable phone, panel, or other computer on the network.

Start from Run and Debug​

New projects include a Start AVS Live Preview launch configuration in .vscode/launch.json.

Open Run and Debug, select Start AVS Live Preview, and press F5 or the Play button. In a workspace with multiple debug configurations, verify the selected configuration first. Stopping that debug session terminates its preview. A preview launched directly from the Command Palette is not the same as an active F5 debug session.

Live Preview example​

This recording shows the Smart Home demo in the visual editor and in the running browser preview. Watch how scene selection and lighting controls update the displayed values and selected-button highlights.

The controls use local demo state. This example demonstrates browser interaction and visual feedback; no smart-home hardware is connected.

Edit and test a page​

Use a short repeatable cycle:

  1. Select an element in VS Code and change one setting in its sidebar.
  2. Save the owning page or data document. In an action form, use Save action & close before saving the page.
  3. Return to the preview and confirm that the expected page and updated content are displayed.
  4. Exercise the actual event: press, release, hold, or change a value.
  5. Check the result, then change the next setting.

For example, after configuring a button's Routing action, activate it in preview and confirm the destination page opens. The selection outline in the editor is not evidence that the action ran. If the project opens on another page, navigate to the page under test or review the project's start-page configuration.

Test initial values separately from feedback. A label that displays its default value proves rendering, but does not prove that a datasource or processor has supplied a new value.

Check 27.0.29 runtime features​

The canvas uses datasource Local Data and keeps element entrance effects static. Use the running preview to test remote data, visibility and animations, Custom Element interactions, Audio actions, and the runtime API.

The status-bar env choice supplies editor/preview values; switching it restarts affected connector drivers. Verify the intended environment before testing equipment. A production build makes its own env selection; see Environment files.

Test another device​

Choose dimensions in VS Code​

With an AVstudio visual editor tab active, run Select editor window size. Choose a preset or Add Custom Size… for your target dimensions. The current preset has a check mark.

Select editor window size picker with panel, phone, tablet, desktop, and custom-size choices

The inspected picker includes:

PresetDimensions
AVS-101280 × 752
TSW (1070, 1060, 770)1280 × 800
iPhone 13 / 14390 × 844
iPhone Pro Max430 × 932
iPad Pro 11″1194 × 834
iPad Pro 12.9″1366 × 1024
Desktop (1080p)1920 × 1080

Use Rotate device above the canvas or Rotate editor device from the Command Palette to inspect the other orientation. Check both the resulting layout in the editor and interactions in preview. Preset dimensions and orientation are development aids; they do not replace a test on the real device.

For each target size, check long labels, container wrapping, scrolling, overlays, global slots, and controls near the screen edges. See Containers and responsive layout when the page needs to adapt to a narrower viewport.

Open on a physical device​

Keep the preview server running and open its Network URL on the target. A localhost or 127.0.0.1 address refers to the device opening it, so it cannot identify your workstation from a phone.

If the page cannot load, check the current URL and port, network reachability, and firewall access. Then test the target's access to any external services used by the project. Loading the UI from the development computer does not prove that all of its connectors or media sources are reachable from the target.

AVStudio DevTools in Live Preview​

AVStudio DevTools is an AVstudio-specific panel inside Chrome Developer Tools. Use it while the project is running to inspect global variable values, check connector status, and inject Crestron feedback for UI testing. It complements the browser's Console and Network panels.

Smart Home running in Live Preview with Chrome&#39;s AVStudio DevTools panel showing Variables, Connectors, and Crestron Emulation

AVStudio DevTools beside the Smart Home demo in NG 27.0.5. Variables shows No data because this demo uses page parameters and has no global variables. Click the screenshot to view it at full resolution.

Open the panel​

  1. Start Open Live Preview (Browser) from VS Code and use the Chrome window launched for that preview. NG loads its bundled DevTools extension into this dedicated browser session.
  2. Open Chrome Developer Tools with Option+Command+I on macOS or Ctrl+Shift+I on Windows/Linux, or choose More tools → Developer tools in Chrome's menu.
  3. Select the AV Studio tab. If it is hidden because the dock is narrow, open the » overflow menu. The panel heading is AVStudio DevTools.
  4. Keep the running preview as the inspected page. Choose Variables, Connectors, or Crestron Feedbacks inside the panel. In the current package, Crestron Emulation is a collapsed section inside Crestron Feedbacks; older captures show a separate tab.

Docking DevTools beside the preview reduces the page's available width. Check whether a layout change is caused by the smaller viewport; undock DevTools or resize the dock when testing the intended device dimensions.

Variables: inspect current global values​

The Variables tab displays Variable Name, Type, and Value. Values update as the running project changes. Enter part of a name in Filter variables by name... to narrow the list; matching is case-insensitive. Clear the filter to see all available rows.

This table is a read-only view of global variables, not the page-parameter editor. Create and configure variables in VS Code through Open Variables.

In the Smart Home avstudio-docs-sample screenshot, the table correctly shows No data: global.variables contains an empty object, while scene, lighting, temperature, and shades controls use parameters declared on start.page. Working local controls therefore do not require rows in this table. Inspect those parameter declarations through Parameters: 6 on the VS Code canvas or Open Page Parameters.

AVStudio DevTools Variables tab listing string and boolean values in the Product Guide presentation project

A project with global variables populates the table. This guide example includes backend status, media-command results, and navigation values; it is a different project from the local Smart Home demo.

For a project with a global volume variable, filter for volume, operate its bound control, and check the Value changes. A default value alone does not prove that external feedback arrived; test an incoming update separately.

Connectors: inspect runtime connection state​

The Connectors tab lists the runtime connector entries with Connector, Type, Status, and Details. It reports the active runtime state rather than editing connector files.

Status or detailHow to use it
ConnectingWait for connection establishment, then check whether it reaches Connected or reports an error.
ConnectedThe driver reports an established connection; still verify command receipt and incoming data.
DisconnectedCheck the endpoint, transport, credentials, and whether the runtime is reconnecting.
ErrorRead Details for the reported error, then inspect Console or Network as appropriate.
Connection time / polling detailsWhere supplied by the driver, Details shows the connected-since time, consecutive polling failures, or last successful poll.

AVStudio DevTools Connectors tab showing connected Crestron, MQTT, and Web entries alongside a KNX fetch error

The Product Guide capture shows different outcomes per connector: Crestron, MQTT, and Web report Connected, while KNX reports Error with Failed to fetch. Inspect the failing entry rather than assuming every project connection has the same status.

If the list is empty, check whether the project has configured runtime connectors. The Smart Home example has no configured hardware connection. A connector file or a Connected status alone does not verify join mappings, message paths, or a device operation. Configure files in VS Code using Connector setup.

Crestron Feedbacks: inspect live signals​

Added in 27.0.35, Crestron Feedbacks lists signals touched by the running page, including subscribed, read, published, and emulated signals. The table shows join, Digital/Analog/Serial type, current and previous values, a Last Update timestamp, and a changed badge. Filter by join text, type, or the 10-second, 1-minute, or 5-minute update window. It refreshes about once per second while open.

Click the pencil in a row's Value column to emulate that signal. The dialog already has its join and type; enter the new value and send it. Check both the updated row and the receiving UI. For a signal not yet listed, expand Crestron Emulation above the table and enter its type, join, and value.

Last Update is observed by the panel between polls, beginning when it first sees the signal; it is not a processor timestamp or a record of earlier activity. Rows can remain after a subscription ends until the preview page reloads. If the panel cannot read the signal map, check its error and the active Crestron runtime.

Crestron Emulation: test incoming feedback​

Open Crestron Feedbacks → Crestron Emulation to simulate a control system sending feedback into the running interface. Prepare the project's Crestron connector and the property, variable, or mode binding you want to test first.

  1. Choose Crestron Data Type: Digital, Analog, or Serial.
  2. Enter the join number or signal/contract name in Join, matching the receiving binding.
  3. Set Value: a true/false switch for Digital, a number for Analog, or text for Serial.
  4. Click Send data and read the success or error message.
  5. Check the bound UI property or mode. If feedback updates a global variable, check its row in Variables too.
  6. Send a second value to verify the interface follows subsequent changes.

Crestron Emulation with Digital, Analog, and Serial options, a Join field, a Value field, and Send data

The historical Product Guide capture shows the separate Emulation tab with Serial selected and empty Join/Value fields. In 27.0.41, expand Crestron Emulation inside Crestron Feedbacks and fill the fields for your binding.

For example, with activeModeIndex bound to !crestron:type=boolean;name=101!, send Digital join 101 with false, then true: the element should change from Default to its first added mode. For an analog binding, send two distinct values within the control's configured range. For serial feedback, send a recognizable status label.

The panel injects feedback into the local Crestron library; it does not send a command to a processor or prove hardware connectivity. A success message confirms injection, so also verify the intended consumer changes. If it reports CrComLib not available, check the active Crestron connector and the inspected preview page. The Smart Home demo shown here uses local parameter actions; it needs a Crestron binding before this test can drive its controls. See Crestron feedback and emulation for the equivalent Console methods.

If the panel is missing or empty​

SymptomWhat to check
No AVStudio tabCheck the overflow menu and use the dedicated Chrome window opened by the NG preview command. Opening the URL in another Chrome profile does not automatically load the bundled DevTools extension.
Tab still absent in the preview browserClose and reopen Developer Tools; check VS Code notifications for Failed to load AVStudio DevTools extension. Restart the preview workflow if needed.
Variables shows No dataClear the name filter, check global.variables, and distinguish global variables from page parameters.
Expected values never updateConfirm DevTools is attached to the correct live project/page, then inspect Console and the actual receiving binding.
Emulation succeeds but the control does not changeCheck join type/name, binding scope, and the element's mode/value mapping.

Set development logging​

Click the Log level status bar item or run Set Live Preview log level.

LevelOutput
silentNo action/connector console output
errorErrors
warnErrors and warnings
infoAlso confirms sent actions
debugMaximum detail, including device/broker write confirmations

Live Preview logging picker with debug marked as the current level

The check mark identifies the current level; the highlighted row is only the current picker selection. Choose a level to apply it or press Escape to leave it unchanged.

The selection is stored in VS Code workspace state. It does not change the project's production logging setting. The loglevel field in avstudio.config controls exported builds.

In 27.0.41, Custom Element frames follow this workspace selection too: debug enables their diagnostic trace, while other levels keep that trace quiet.

Debug a failing control​

Use VS Code Problems for project diagnostics, Output → AVStudio Live Preview for startup information, and the running preview's browser Console for runtime messages. The VS Code Debug Console is not automatically the browser Console.

  1. Run the health check and resolve the relevant project errors.
  2. Set the development log level to info or debug when you need action details.
  3. Open browser developer tools for the running preview and select Console.
  4. Trigger one control and inspect the first relevant error or action message.
  5. Verify the event, target reference, outgoing payload, and incoming feedback in that order.
  6. Repeat the interaction after correcting the underlying setting.

For a failed request, inspect the browser's Network panel as well: check whether a request was sent, its destination, response status, and payload. A console message that a command was sent is not proof that a physical device changed state.

For Crestron UI-only testing, use feedback emulation.

RTSP video requires App Container and will not play in ordinary browser preview. Confirm runtime-specific behavior on the target device.

Troubleshooting​

SymptomWhat to check
Clicking a control only selects itYou are on the design canvas. Exercise the control in the running preview.
Preview command is missingCorrect workspace, installed/active NG extension, and a recognized AVstudio project.
F5 starts another toolSelect Start AVS Live Preview in Run and Debug.
Browser did not openInspect the startup output. If a Local URL was reported, open that URL in a browser on the same computer.
An old preview URL no longer loadsStart preview again and use its current reported port.
Changes do not appearSave the action form and owning file, confirm the workspace/page, and reload the correct running preview if necessary.
Another device cannot load the pageUse the Network URL, keep the server running, and check network/firewall access.
Logs are missingCheck development log level and browser Console filters; silent suppresses action/connector output.
Display stays on its default valueVerify the incoming datasource or feedback binding independently of rendering.
A device command failsCheck the connector, action payload, credentials, transport, and actual device response.
Media works differently on the targetCheck runtime support and device permissions; browser preview cannot validate every native media feature.

After a preview test, verify the built project on its intended runtime too. Development settings and a successful local layout check do not guarantee identical device, network, or media behaviour in the exported application.