编译到模拟器时如何排除Xcode中的框架

我已经在我的项目中包含了TokBox框架,所以我们可以做video短信。 问题是框​​架以及他们需要的其他框架不会让你编译或运行模拟器中的应用程序; 他们不支持。

有没有办法在编译到模拟器时设置编译器标志跳过TokBox和其他框架? 原因是我需要testing我们的应用程序在iPhone 4,4s 5,5s和9月9日出来的任何设备。 我不拥有每种types的电话之一。

得到这个错误:

file was built for archive which is not the architecture being linked (i386) 

我将其添加到我的其他链接标志为“任何iOS模拟器SKD”,但仍然失败

  "-ObjC -framework MobileCoreServices -framework SystemConfiguration -framework OpenTok" 

以下是解决这个问题的步骤。

通过“构build阶段”>“使用库链接二进制文件”(而不是必需),使OpenTok框架成为可选项。

您可能需要从Project Navigator中删除OpenTok框架,并链接Binary With Libraries,然后清理然后添加回来并使其成为可选项。

在“生成设置”>“链接其他链接器标志”链接你应该有一个debugging和释放。 在debugging下添加一个新的,在右侧select“任何iOS模拟器SDK”键入这个-weak_framework OpenTok

在这里输入图像说明

然后在参考开放式谈话的所有课程中,您需要做这样的事情。

 #if TARGET_IPHONE_SIMULATOR @interface TokBoxVideoViewController (){ NSMutableDictionary *allStreams; NSMutableDictionary *allSubscribers; NSMutableArray *allConnectionsIds; OTSession *_session; OTPublisher *_publisher; OTSubscriber *_currentSubscriber; CGPoint _startPosition; BOOL initialized; } #else @interface TokBoxVideoViewController ()<OTSessionDelegate, OTSubscriberKitDelegate, OTPublisherDelegate>{ NSMutableDictionary *allStreams; NSMutableDictionary *allSubscribers; NSMutableArray *allConnectionsIds; OTSession *_session; OTPublisher *_publisher; OTSubscriber *_currentSubscriber; CGPoint _startPosition; BOOL initialized; } #endif