is_android_emulator 0.0.1 copy "is_android_emulator: ^0.0.1" to clipboard
is_android_emulator: ^0.0.1 copied to clipboard

PlatformAndroid

A lightweight Flutter package to detect if the current device is an Android emulator with zero heavy transitive dependencies.

is_android_emulator #

A lightweight Flutter package plugin to detect if the current device is an Android emulator or physical hardware device.

Inspired by is_ios_simulator, this package focuses strictly on Android emulator detection without introducing heavy transitive dependencies (such as device_info_plus, win32, or win32_registry).

Features #

  • 🚀 Zero Heavy Dependencies: Uses lightweight native Android Build property inspection.
  • 🌐 Web & Cross-Platform Safe: Uses conditional imports to ensure web and non-Android builds return false without crashing.
  • Simple & Clean API: Provides both a top-level function and a class wrapper API.

Motivation #

Existing packages such as device_info_plus provide broad device info, introducing additional transitive dependencies (e.g., win32, win32_registry) when only Android emulator detection is required.

Unused dependencies and/or code introduce additional surface area and maintenance overhead in the long term.

is_android_emulator is useful for published pub.dev packages that may want to detect an Android emulator while adding a single, tiny transitive dependency.

Installation #

Add is_android_emulator to your pubspec.yaml:

dependencies:
  is_android_emulator: ^0.0.1

Usage #

Top-level function #

import 'package:is_android_emulator/is_android_emulator.dart';

final result = await isAndroidEmulator();
print('Is Android Emulator: $result');

Alternative API #

import 'package:is_android_emulator/is_android_emulator.dart';

final detection = AndroidEmulatorDetection();
final result = await detection.isAndroidEmulator();

print('Is Android Emulator: $result');

How It Works #

On Android, the plugin checks native system build properties (Build.FINGERPRINT, Build.MODEL, Build.MANUFACTURER, Build.HARDWARE, Build.PRODUCT, Build.BOARD, etc.) to reliably identify emulators (including Android Studio AVD, Genymotion, BlueStacks, Nox, and x86 emulators).

On Web and non-Android platforms, it gracefully returns false.

0
likes
160
points
51
downloads

Documentation

API reference

Publisher

verified publisherrizkyghofur.my.id

Weekly Downloads

A lightweight Flutter package to detect if the current device is an Android emulator with zero heavy transitive dependencies.

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

flutter

More

Packages that depend on is_android_emulator

Packages that implement is_android_emulator