1

有什么方法可以在代码中确定当前运行的应用程序是开发人员、临时还是应用商店构建的?

4

1 回答 1

1

You could add C preprocessor definitions for each type to your build configuration, and use that definition to set a variable or flag in executable code.

Debug builds can be sometimes be detected by calling a benchmark loop whose run time varies significantly between -O0 and -Os optimization levels on a known device model.

Apple is reported to change an app's Info.plist in App store distributions, so you could count and checksum the plist items.

于 2010-09-23T20:59:30.483 回答