直接上代码啦!!!
- (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view. self.title=@"判断是否是模拟机"; [self isSimulator]; } #pragma -mark -functions -(void)isSimulator { if (TARGET_IPHONE_SIMULATOR) { NSLog(@"是模拟机"); }else{ NSLog(@"不是模拟机"); } }