如何在编译到模拟器时排除Xcode中的框架 [英] How to exclude frameworks in Xcode when compiling to the simulator

查看:580
本文介绍了如何在编译到模拟器时排除Xcode中的框架的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已将TokBox框架包含在我的项目中,因此我们可以进行视频短信。问题是框​​架和他们需要的其他框架不允许您在模拟器中编译或运行应用程序;它们不受支持。

I have included the TokBox framework in my project so we can do video SMS. The issue is that the framework along with some others they require will not let you compile or run the app in the simulator; they are not supported.

有没有办法在编译到模拟器时设置编译器标志跳过TokBox和其他框架?原因是我需要在iPhone 4,4s 5,5s以及9月9日发布的任何设备上测试我们的应用程序。我不拥有每种类型的手机。

Is there a way to set a compiler flag to skip the TokBox and other frameworks when compiling to the simulator? The reason is I need to test our app on iPhone 4, 4s 5, 5s and whatever devices that come out Sept 9th. I don't own one of each type of phone.

获取此错误:

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

I将此添加到我的任何iOS模拟器SKD的其他链接标记但仍然失败

I add this to my OTHER LINKER FLAGS for "Any iOS Simulator SKD" but still failing

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


推荐答案

以下是修复此问题的步骤。

Here are the steps to fix this.

从Build Phases> Link Binary With Libraries中选择OpenTok框架而不是必需。

Make OpenTok framework optional from the Build Phases > Link Binary With Libraries instead of required.

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

在构建设置中>链接其他链接器标志你应该有一个调试和发布。
在Debug下添加一个新的并选择右侧的Any iOS Simulator SDK键入-weak_framework OpenTok

In Build Settings > Linking in "Other Linker Flags" you should have a Debug and Release. Under Debug add a new one and choose "Any iOS Simulator SDK" on the right side type this -weak_framework OpenTok

然后在所有引用开放式谈话的类中,你需要做的事情类似这样的事情。

Then in all the classes that reference open talk you need to do something like this.

#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

这篇关于如何在编译到模拟器时排除Xcode中的框架的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆