gpt4 book ai didi

iphone - 以编程方式检测应用程序是否正在设备或模拟器上运行

转载 作者:IT王子 更新时间:2023-10-29 07:35:54 25 4
gpt4 key购买 nike

我想知道我的应用在运行时是在设备上运行还是在模拟器上运行。有没有办法检测到这一点?

原因是用模拟器测试蓝牙 api: http://volcore.limbicsoft.com/2009/09/iphone-os-31-gamekit-pt-1-woooohooo.html

最佳答案

#if TARGET_OS_SIMULATOR

//Simulator

#else

// Device

#endif

请同时引用之前的 SO 问题 What #defines are set up by Xcode when compiling for iPhone

关于iphone - 以编程方式检测应用程序是否正在设备或模拟器上运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5775420/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com