Skip to content

[Question]: [Bug]: 'BlueStacks' emulator is detected as physical device with AndroidDeviceInfo.isPhysicalDevice #3378

@naw2nd

Description

@naw2nd

What is your question?

Here's my code for detecting if my apps run on a real device or emulator.

Future<bool> isRealDevice() async {
   try {
     if (Platform.isAndroid) {
       AndroidDeviceInfo androidDeviceInfo =
           await deviceInfoPlugin.androidInfo;
       return androidDeviceInfo.isPhysicalDevice;
     }
     if (Platform.isIOS) {
       IosDeviceInfo iosDeviceInfo = await deviceInfoPlugin.iosInfo;
       return iosDeviceInfo.isPhysicalDevice;
     }
     return false;
   } catch (e) {
     return false;
   }
 }

When I'm using Android Studio Emulator it is successfully detected as not a real device.
But when I tested it on BlueStacks emulator, it was detected as a real device (not emulated, as it should be).

it also happens in MEmu emulator (it was detected as a real device).

Checklist before submitting a question

  • I searched issues in this repository and couldn't find such bug/problem
  • I Google'd a solution and I couldn't find it
  • I searched on StackOverflow for a solution and I couldn't find it
  • I read the README.md file of the plugin
  • I am using the latest version of the plugin
  • All dependencies are up to date with flutter pub upgrade
  • I did a flutter clean
  • I tried running the example project

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions