1.2.5 |
|
---|---|
1.2.4 |
|
1.1.3 |
|
0.1.0 |
|
#130 in #tauri-plugin
267 downloads per month
48KB
284 lines
Tauri Plugin is-simulator
A simple Tauri plugin to check if the app is running in a simulator.
Supported Platforms
- iOS
- Android
Installation
Rust
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");
}
JavaScript Bindings
Install the JavaScript bindings:
npm install tauri-plugin-is-simulator
Usage
import { isSimulator } from 'tauri-plugin-is-simulator';
console.log(`Is simulator: ${await isSimulator()}`);
Dependencies
~18–57MB
~853K SLoC