How do you prevent app run in android emulator (LDplayer or bluestack)

how to prevent app run in android emulator (LDplayer or bluestack), thank you !

I think you would need a hack of some sort. There are of course more emulators than just LD and Bluestacks, so it could be mission impossible.

Essentially your App would need to query something that a phone has but an emulator does not. If the query is not successful, exit App.