home ~ projects ~ socials

Automatically Open Dev Tools In A Tauri App

Add a .setup() into the main function like this:

use tauri::Manager;

fn main() {
    tauri::Builder::default()
        .setup(|app| {
            {
                let window = app.get_window("main").unwrap();
                window.open_devtools();
            }
            Ok(())
        })
        .run(tauri::generate_context!())
        .expect("error while running tauri application");
}
-- end of line --

References