//here use sys/utsname.h
struct utsname systemInfo;
uname(&systemInfo);
//get the device model and the system version
NSLog(@"%@", [NSString stringWithCString:systemInfo.machine encoding:NSUTF8StringEncoding]);
NSLog!@"%@", [[UIDevice currentDevice] systemName]); //IOS
NSLog(@"%@", [[UIDevice currentDevice] systemVersion]); //5.1