Joey Carson
Joey Carson

Reputation: 3113

Why does the iOS simulator require i386 and x86_64 symbols even though I'm on an x86_64 system only?

I'm trying to get an app running on the simulator that has had some problems doing so before. We don't have libjpeg.a built for i386, but it does have x86_64. This is the only dependency left, but I'm wondering why I actually need i386 symbols, if I'm running on an x86_64 mac.

Upvotes: 33

Views: 42507

Answers (4)

Variable Length Coder
Variable Length Coder

Reputation: 8116

The iOS simulator can run your app in 32 and 64-bit modes. This allows you to work out a lot of 64-bit issues and make sure it is ready for both armv7 and arm64. To do this, it compiles your app for i386 and x86_64 and requires the libraries for both architectures.

Upvotes: 42

ifeegoo
ifeegoo

Reputation: 7292

While these days I have tried to run Fastlane to get iOS screen capture, I found the same situation:Because there is .a library contains only x86_64 architecture,but without i386 architecture,and then I got this error:

Undefined symbol(s) for architecture i386

This is running on iPhone 8 simulator with iOS 11.4.

But you can force the simulator to run on only 64-bit or only 32-bit as follows:

Project -> Architectures -> set the value as:$(ARCHS_STANDARD_32_BIT) or $(ARCHS_STANDARD_64_BIT)

Upvotes: 9

Naishta
Naishta

Reputation: 12373

iOS apps need to run on many different architectures:

arm7: Used in the oldest iOS 7-supporting devices
arm7s: As used in iPhone 5 and 5C
arm64: For the 64-bit ARM processor in iPhone 5S
i386: For the 32-bit simulator
x86_64: Used in 64-bit simulator

Upvotes: 28

Syed Ali Salman
Syed Ali Salman

Reputation: 2915

actually i386 architecture is for iPhone simulator where as x86_64 architecture is for iPad simulators, both are 32 and 64bit compatible.

Upvotes: 8

Related Questions