Thanks for the replay @DTS Engineer. You are right on my requirement, currently I am looking for iOS but I would be happy with a solution that works across apple platforms as well.
If so, to what end?
To answer your query on why I want to detect debug build I won't be able to share my exact use-case but I will share a parallel use-case that currently Apple uses:
Currently Apple allows developers to send push notifications to iOS with APNS. From what I understand, APNS exposes sandbox and production environments which are controlled with aps-environment entitlement. Since, Apple controls the tooling side of iOS development, they can inject entitlement based on the provisioning profile.
I want to achieve something similar to this where the REST API domain used by my framework is decided based on either provisioning profile or build type.
A lot of the time it’s not the build configuration that matters, it’s the way that the app was signed. Or the way that’s it’s run (from Xcode or like a user would). And those questions have different answers.
I think more appropriate solution for me will be deciding based on the way app was signed, something like what Apple does for APNS. I did look into it but was unable to find any way to parse the included provisioning profile. Would appreciate any help with this.