| Crates.io | tauri-plugin-is-simulator-temp |
| lib.rs | tauri-plugin-is-simulator-temp |
| version | 1.2.5 |
| created_at | 2024-12-15 19:53:55.227112+00 |
| updated_at | 2024-12-16 11:04:46.548277+00 |
| description | A simple Tauri plugin to check if the app is running in a simulator. |
| homepage | |
| repository | |
| max_upload_size | |
| id | 1484381 |
| size | 124,393 |
A simple Tauri plugin to check if the app is running in a simulator.
Run the following command in the src-tauri folder to add the plugin to the project’s dependencies in Cargo.toml:
cargo add tauri-plugin-is-simulator
Modify lib.rs to initialize the plugin:
#[cfg_attr(mobile, tauri::mobile_entry_point)]
pub fn run() {
tauri::Builder::default()
.setup(|app| {
#[cfg(mobile)]
app.handle().plugin(tauri_plugin_is_simulator::init());
Ok(())
})
.run(tauri::generate_context!())
.expect("error while running tauri application");
}
Install the JavaScript bindings:
npm install tauri-plugin-is-simulator
import { isSimulator } from 'tauri-plugin-is-simulator';
console.log(`Is simulator: ${await isSimulator()}`);