使用TARGET_IPHONE_SIMULATOR和TARGET_OS_IPHONE区分模拟器和真机
#if TARGET_IPHONE_SIMULATOR
#include
#else
#include “route.h”
#endif
注意不要用#ifdef TARGET_IPHONE_SIMULATOR, 因为在device上, TARGET_IPHONE_SIMULATOR被定义为0。、
TARGET_OS_IPHONE的用法也一样。
使用TARGET_IPHONE_SIMULATOR和TARGET_OS_IPHONE区分模拟器和真机
#if TARGET_IPHONE_SIMULATOR
#include
#else
#include “route.h”
#endif
注意不要用#ifdef TARGET_IPHONE_SIMULATOR, 因为在device上, TARGET_IPHONE_SIMULATOR被定义为0。、
TARGET_OS_IPHONE的用法也一样。
Title:如何区分模拟器和真机调试
Author:Lynn Cheng
Created:2017-01-22, 17:53:47
Updated:2017-01-22, 17:55:11
Full URL:http://lynncheng.github.io/2017/01/22/如何区分模拟器和真机调试/
License: "CC BY-NC-SA 4.0" Keep Link & Author if Distribute.