Join Slack
Communities
Powered by
Hi, quick question: what’s the best way to detect ...
# multiplatform
u
ubuntudroid
07/20/2023, 2:41 PM
Hi, quick question: what’s the best way to detect whether the code is running on a simulator from Kotlin/multiplatform code?
ubuntudroid
07/20/2023, 3:04 PM
Solution in an iOS actual implementation:
Copy code
NSProcessInfo.processInfo.environment["SIMULATOR_DEVICE_NAME"] != null
a
Arkadii Ivanov
07/20/2023, 3:44 PM
I believe there are separate targets for simulators? E.g. iosX64 and iosSimulatorArm64. Could be an expected/actual flag as well.
10
Views
Open in Slack
Previous
Next