Hi, just want to ask if players can set Debug.isDebugBuild to true in a non-development build apk/aab manipulating something in the apk. For example, if I have functions that I only want to run for development and are protected by checking if Debug.isDebugBuild and I dont want to all players access to it, have they a way to turn it on?
Don’t overthink trying to prevent a user from running code you didn’t want them to.
If they are a user who hacks your game to run code, they can already change all the data, so why do you care if they can also run code?
Instead focus on making your game great.
If you are worried about size, look into conditional compilation.
@Kurt-Dekker 's advice is correct. At the same time, there are plenty of legitimate reasons to exclude code from production builds. Just don’t think of it as “Security”. It’s not going to stop anyone from cheating in your game, for example.
You can use this feature to stop certain code from making it into your builds under certain situations: Unity - Manual: Conditional compilation. Search for DEVELOPMENT_BUILD
on that page for your use case.
Such excluded code cannot be retrieved by the end user, since it will not exist in your build.