Possible Duplicate:
Programmatically detect if app is being run on device or simulator
How can I detect whether my app is running on Simulator or on Device via code.
Keep in mind UIDevice
provides you already with information about the device itself.
[[UIDevice currentDevice] model]
You can also use the following:
TARGET_IPHONE_SIMULATOR
tells you if you're in the iPhone simulator.
TARGET_OS_IPHONE
tells you that you're working on the iPhone instead of MacOS.
#if TARGET_IPHONE_SIMULATOR
NSLog(@"Running in Simulator - no app store or giro");
#else
NSLog(@"Running on the Device");
#endif
and when ONLY interested in the device
#if !(TARGET_IPHONE_SIMULATOR)
NSLog(@"Running on device");
#endif
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With