tauri-plugin-devtools-app

Crates.iotauri-plugin-devtools-app
lib.rstauri-plugin-devtools-app
version2.0.0-beta.4
sourcesrc
created_at2024-05-23 14:29:27.585228
updated_at2024-07-13 05:48:34.23335
descriptionConnect with the Devtools for Tauri application
homepage
repositoryhttps://github.com/crabnebula-dev/devtools
max_upload_size
id1249566
size369,904
CrabNebula (CrabNebula-Bot)

documentation

README

Devtools Desktop App Plugin

Connect with the CrabNebula DevTools Desktop application and embed the devtools view in your application.

This plugin extends the DevTools for Tauri plugin by easily interfacing with the DevTools Desktop app, allowing you to directly open the DevTools user interface either as a embedded view or in a standalone window.

Getting Started

Ensure you have Tauri set up correctly. Then install the Rust instrumentation from crates.io:

cargo add tauri-plugin-devtools
cargo add tauri-plugin-devtools-app

Then add the following snippet to your tauri initialization code:

fn main() {
    #[cfg(debug_assertions)] // only enable instrumentation in development builds
    let (devtools, devtools_app) = (tauri_plugin_devtools::init(), tauri_plugin_devtools_app::init());

    let builder = tauri::Builder::default();

    #[cfg(debug_assertions)]
    let builder = builder.plugin(devtools).plugin(devtools_app);

    builder
        .run(tauri::generate_context!("./tauri.conf.json"))
        .expect("error while running tauri application");
}

And then run your app as usual, if everything is set up correctly you will be able to right-click on the window and select the "Open DevTools" menu or use the "Ctrl + Shift + M" (Linux and Windows) or "Cmd + Shift + M" (macOS) shortcuts.

Commit count: 748

cargo fmt