mac上的iOS模拟器运行的是i386架构,而不是armv7?

发布于 12-11 10:50 字数 241 浏览 0 评论 0原文

我已经构建了一些用于 armv7 架构的静态库。当我尝试在 iPhone 5.0 模拟器上测试运行的 iOS 项目中使用它们时,我收到错误消息,告诉我静态库中的架构 i386 的未定义符号

所以我猜这意味着 iphone 模拟器想要为 i386 编译库?那么模拟器的意义何在——为什么它不模拟armv7架构呢?

那么我测试静态库的唯一方法就是连接物理 iOS 设备并运行它?

还是我理解错了?

I've got some static libraries I've built for use on armv7 architectures. When I try to use them in a iOS project which I testrun on the iphone 5.0 simulator, I get errors telling me about undefined symbols for architecture i386 in my static libraries.

So I guess this means the iphone simulator wants libraries compiled for i386? What is the point of the simulator then - why dosn't it emulate armv7 architecture as well?

So the only way I can test my static libraries is to connect a physical iOS device and run it?

Or did I get it wrong?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

听风吹2024-12-18 10:50:17

所以我猜这意味着 iPhone 模拟器想要编译库
对于i386?那么模拟器的意义何在——为什么不呢?
也模拟armv7架构?

你已经回答了你自己的问题。它是一个模拟器,而不是仿真器。因此它是一个Mac OSX程序,运行在i386架构上。如果您也为 i386 编译静态库,您将能够在模拟器上使用它们。

So I guess this means the iphone simulator wants libraries compiled
for i386? What is the point of the simulator then - why dosn't it
emulate armv7 architecture as well?

You've answered your own question. It's a simulator, not an emulator. Therefore it is a Mac OSX program, running on i386 architecture. If you compile your static libraries for i386 as well you will be able to use them on the simulator.

陌路黄昏2024-12-18 10:50:17

我不太确定,但i386适用于模拟器armv7适用于已连接到计算机的设备

I am not very sure but i386 is for Simulator and armv7 is for Devices that you have connected to your Machine.

窗影残2024-12-18 10:50:17

您实际上可以使用 i386 架构通过 Xcode 命令行工具编译应用程序(还有一种方法可以通过修改构建设置在 Xcode UI 中运行它)。

xcodebuild -sdk iphonesimulator6.1 -arch i386 VALID_ARCHS="i386 armv7 armv7s" clean install

在包含 projectName.xcodeproj 文件的目录中运行此命令。

这是脚本的分解:

-sdk iphonesimulator6.1 // Build the app on iPhone simulator 6.1
-arch i386 // Build your app using i386 architecture
VALID_ARCHS="i386 armv7 armv7s" // Specify these architectures are valid
clean install // Clean all the builds then re-build and install

You can actually compile the app through Xcode command line tool using i386 architecture (there is also a way to run it in Xcode UI by modifying the build settings).

xcodebuild -sdk iphonesimulator6.1 -arch i386 VALID_ARCHS="i386 armv7 armv7s" clean install

Run this command in the directory that you have the projectName.xcodeproj file.

Here's a break down of the script:

-sdk iphonesimulator6.1 // Build the app on iPhone simulator 6.1
-arch i386 // Build your app using i386 architecture
VALID_ARCHS="i386 armv7 armv7s" // Specify these architectures are valid
clean install // Clean all the builds then re-build and install
怎会甘心2024-12-18 10:50:17

如果你想尝试使用 i386 的模拟器,只需选择 =< iPhone 5。

If you want to try simulators with i386 just go for =< iPhone 5.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文