I think it's going to be hard. As yooni126 notes the whole point of an emulator is working exactly like the thing it emulates, so avoiding any differences you might detect.
On top of that it will be especially hard for Android. Android runs on all sorts of devices, and you can only test against a small fraction of them. The danger of adding code to detect emulators is that code might be triggered on real hardware, just hardware with differences which you've not tested.
In addition Android itself runs apps in an emulator of sorts, inside the JVM. An emulator on e.g. a PC would probably use a JVM which will look identical to Java/Kotlin bytecode. So you can't e.g. try timing code to see if it has non-native performance due to an emulator.