is_ios_simulator 1.0.0 copy "is_ios_simulator: ^1.0.0" to clipboard
is_ios_simulator: ^1.0.0 copied to clipboard

PlatformiOS

Checks whether the app is running in the iOS Simulator or on a physical device

iOS simulator detection #

import 'package:is_ios_simulator/is_ios_simulator.dart';

void main() async {
    final result = await isIosSimulator();
    print(result);
}

Alternative API (consumed by the top-level isIosSimulator function):

final detection = IosSimulatorDetection();
final result = await result.isIosSimulator();
print(result);

Why reinvent the wheel? #

Packages like device_info_plus provide broad device info, introducing unnecessary transitive dependencies (e.g., win32, win32_registry) when only iOS simulator detection is required.

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

Useful for published pub.dev packages that may want to detect an iOS simulator while adding a single, tiny transitive dependency.

Swift Implementation #

#if targetEnvironment(simulator)
    return true
#else
    return false
#endif
1
likes
150
points
72
downloads

Documentation

API reference

Publisher

verified publisherechoellet.dev

Weekly Downloads

Checks whether the app is running in the iOS Simulator or on a physical device

Repository (GitHub)
View/report issues

Topics

#ios #simulator #device

License

MIT (license)

Dependencies

flutter, meta

More

Packages that depend on is_ios_simulator

Packages that implement is_ios_simulator