Is It Just the iPhone Simulator That Is Restricted to Intel Only MAC'S

Can I access the App Store from within the iOS Simulator?

It's a simulator not an emulator. Even if there was an App Store in the Simulator, none of the apps in the store would work since they are compiled for ARM CPUs while the Simulator runs x86 code.

Xcode error 'building for iOS Simulator, but linking in dylib built for iOS .. for architecture arm64' from Apple Silicon M1 Mac

Answering my own question in a hope to help others who are having similar problems. (and until a good answer is added from another user)

I found out that GoogleWebRTC actually requires its source to be compiled with x64 based on its source depo.

For builds targeting iOS devices, this should be set to either "arm" or "arm64", depending on the architecture of the device. For builds to run in the simulator, this should be set to "x64".

https://webrtc.github.io/webrtc-org/native-code/ios/

This must be why I was getting the following error.

building for iOS Simulator, but linking in dylib built for iOS, file '/Users/andy/workspace/app/Pods/GoogleWebRTC/Frameworks/frameworks/WebRTC.framework/WebRTC' for architecture arm64

Please correct me if I am wrong, but by default, it seems that Xcode running in Apple M1 silicon seems to launch iOS simulator with arm arch type. Since my app did run fine on simulators in Intel Mac, I did the following as a workaround for now.

  1. Quit Xcode.
  2. Go to Finder and open Application Folder.
  3. Right click on Xcode application, select Get Info
  4. In the "Xcode Info Window" check on Open using Rosetta.
  5. Open Xcode and try running again.

That was all I needed to do to make my app, which relies on a library that is not yet fully supported on arm simulator, work again. (I believe launching Xcode in Rosetta mode runs simulator in x86 as well..?? which explains why things are working after making the above change)

A lot of online sources (often posted before M1 Mac launch on Nov/2020) talks about "add arm64 to Excluded Architectures", but that solution seems to be only applicable to Intel Mac, and not M1 Mac, as I did not need to make that change to make things work again.

Of course, running Xcode in Rosetta mode is not a permanent solution, and Xcode slows down lil bit, but it is an interim solution that gets things going in case one of libraries that you are using is not runnable in arm64 simulator.. yet.

Xcode 12.3: Building for iOS Simulator, but the linked and embedded framework was built for iOS + iOS Simulator

I'm afraid that this is actually the correct error and the framework shouldn't contain iOS and iOS Simulator code at the same time. Apple tries to force us to use XCFrameworks for this purpose. They started it in Xcode 11 and just tightened up the restrictions.

The only correct way to resolve this is to rebuild the framework as an XCFramework. Which is easy to do:

xcrun xcodebuild -create-xcframework \
-framework /path/to/ios.framework \
-framework /path/to/sim.framework \
-output combined.xcframework

You can start with a combined .framework. Make two copies of the framework, and use lipo to remove the slices from the binary that are associated with a different SDK.

It is based on the original answer from Apple here.

My particular case is that I'm getting this error using Rome, which produces these frameworks (a possible solution is here). Also, a lot of struggling is going on on the Carthage side.

How to properly develop for the iPhone on a PowerPC Mac?

I had the same problems as you - I could cross compile and install the app on the iphone, but it would always fail with a security violation.

To get around it, I had to jailbreak my phone and install a patched MobileInstaller (I believe the Cydia app now has package called Installous which patches your MobileInstaller. Unfortunately, I think Installous is also used to pirate apps). Then in your project's Info.plist, you need to add the following:

<key>SignerIdentity</key>
<string>Apple iPhone OS Application Signing</string>

This will allow your phone to run unsigned binaries, which is the only way I was able to develop from my ppc mac.

I'm still able to purchase apps from the appstore and have them run without any problems.

Simulator Vs IOS Device Performance

It's just general usage testing. The device performs in an entirely different environment than your computer, and it's the best way to make sure if you push your app out to devices, that nothing unexpected will happen. For example, the phone/pad may have limited data coverage, low memory situations, incoming calls etc.. These situations are a lot more common on devices, then when people emulate it though the simulator.

On a hardware point of view, the device uses a different processor architecture than your Mac, which also needs to be accounted for (not as much as other cases, but you need to cover your bases). The Mac also cannot reliably emulate RAM, Disc Space, Processor Speed etc...hence testing on the device is useful here also.

Overall if you're intending to release your application to the App Store, or to devices at least, it's worth testing on the device itself. Only then can you be sure that it will act and perform as expected on the platform you intend to target. The simulator is only a simulator after all, not the real thing!

Reference from HERE.

Do you need Mac OS X to develop iPhone apps?

Yes, you do need Mac OS X for that. Xcode (SDK) will only work on Mac OS X.
However, if the legal part for you is not really important you can install Mac OS X on your normal PC. Just google "Hackintosh".



Related Topics



Leave a reply



Submit