| run_electron_app | R Documentation |
Launches a previously exported Electron application for testing and debugging
without building distributable packages. Pass the electron-app directory
from a prior export() call.
run_electron_app(
app_dir,
port = 3000,
open_devtools = TRUE,
verbose = TRUE,
update_version = NULL
)
app_dir |
Character string. Path to the Electron application directory
(the |
port |
Integer. Port number for the development server. Default is 3000. |
open_devtools |
Logical. Whether to open Chromium DevTools automatically. Default is TRUE. |
verbose |
Logical. Whether to display detailed progress information. Default is TRUE. |
update_version |
Character string or |
Invisibly returns the completed processx::run() result list
(with status, stdout, and stderr) after Electron exits, or NULL
if the run is interrupted. Note that this call blocks until the Electron
window is closed.
This function starts the Electron application for testing, which:
Opens the application in an Electron window
Optionally opens Chromium DevTools for debugging
Does NOT build distributable packages (use export(build = TRUE) for that)
With update_version, serves a local update feed on 127.0.0.1 and
writes dev-app-update.yml into app_dir for the run, then stops the
feed and removes the file when the run ends, even after an error or
Ctrl+C
# Run a previously exported Electron app in development mode
run_electron_app("path/to/electron/app")
# Run with custom port and no dev tools
run_electron_app(
app_dir = "path/to/app",
port = 8080,
open_devtools = FALSE
)
# Try the update check against a local feed offering version 2.0.0
run_electron_app("path/to/electron/app", update_version = "2.0.0")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.