Hi, quick question: what’s the best way to detect ...
# multiplatform
u
Hi, quick question: what’s the best way to detect whether the code is running on a simulator from Kotlin/multiplatform code?
Solution in an iOS actual implementation:
Copy code
NSProcessInfo.processInfo.environment["SIMULATOR_DEVICE_NAME"] != null
a
I believe there are separate targets for simulators? E.g. iosX64 and iosSimulatorArm64. Could be an expected/actual flag as well.