Question

I've got an app binary, and I would like to know if it was compiled against the iOS 5.x, 6.x, or 7.0 SDK. Is it possible to figure this out?

Was it helpful?

Solution

Extract the IPA and use MachOView to open the binary (Payload/appname.app/appname). On the left open Load Commands -> LC_VERSION_MIN_IPHONEOS MachOView

On the right, there should be four fields.

From usr/include/mach-o/loader.h in iPhone SDK,

/*
 * The version_min_command contains the min OS version on which this 
 * binary was built to run.
 */
struct version_min_command {
    uint32_t    cmd;            /* LC_VERSION_MIN_MACOSX or
                                   LC_VERSION_MIN_IPHONEOS  */
    uint32_t    cmdsize;        /* sizeof(struct min_version_command) */
    uint32_t    version;        /* X.Y.Z is encoded in nibbles xxxx.yy.zz */
    uint32_t    sdk;            /* X.Y.Z is encoded in nibbles xxxx.yy.zz */
};

The 'Version' field here specifies the minimum iOS version required for the app. 'Reserved' field specifies the SDK against which the app was compiled. Use the above structure to decode the SDK version.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top