Replies: 10 comments 7 replies
-
|
We are running |
Beta Was this translation helpful? Give feedback.
-
|
Right now we're building our apps and tests for x86_64 still as we wait on some vendors to support arm64 simulators, for us this has mostly worked fine so far, we haven't noticed any difference in test / app run experience even though it's running through rosetta. We hit a few small snags like the ones @omarzl mentioned around running tests. In Xcode as long as we have a test host (we use an empty app) for each unit test target things work fine, but without them they architecture missing issue. We have the same issue from the command line but we are able to work around that with this hack: platform_developer_dir="$(xcode-select -p)/Platforms/iPhoneSimulator.platform/Developer"
xctest_binary="$platform_developer_dir/Library/Xcode/Agents/xctest"
if [[ $(arch) == arm64 ]]; then
sliced_xctest_binary=/tmp/xctest_intel
if [[ ! -x "$sliced_xctest_binary" ]]; then
lipo -thin x86_64 -output "$sliced_xctest_binary" "$xctest_binary"
fi
xctest_binary=$sliced_xctest_binary
fi
SIMCTL_CHILD_DYLD_FALLBACK_LIBRARY_PATH="$platform_developer_dir/usr/lib" \
SIMCTL_CHILD_DYLD_FALLBACK_FRAMEWORK_PATH="$platform_developer_dir/Library/Frameworks:$platform_developer_dir/Library/Private/Frameworks" \
SIMCTL_CHILD_LLVM_PROFILE_FILE="$profraw" \
xcrun simctl \
spawn \
"$id" \
"$xctest_binary" \
-XCTest All \
"$test_tmp_dir/$test_bundle_name.xctest"Instead of forcing everything through a test host (which just has some impact on performance). We also had to set |
Beta Was this translation helpful? Give feedback.
-
|
I have experienced this issue recently and I got stuck with the GoogleMaps library, that hasn't been updated yet. The solution I found was to wrap it into an You can repurpose the As you can see in the script below, that I forked from another repo and modifed to add the simulator support, after creating the iphoneos archive that uses the https://github.com/vfn/GoogleMaps-SP/blob/main/make_xcframework.sh function convert_frameworks_arm64_to_iphonesimulator() {
project_name=$1
framework_name=$2
xcrun vtool -arch arm64 \
-set-build-version 7 11.0 13.7 \
-replace \
-output "../Carthage/Build/iOS/$framework_name.framework/$framework_name" \
"../Carthage/Build/iOS/$framework_name.framework/$framework_name"
}I mostly followed the instructions in this post https://bogo.wtf/arm64-to-sim-dylibs.html and a bit of trial and error. Depending on how many dependencies you have on your project, it might be worth to do something similar while you wait for them to be updated. In my case, I was experiencing a few UI glitches, like scrolling issues and some others when running the simulator using Rosetta. |
Beta Was this translation helpful? Give feedback.
-
|
In case you missed it, there is an excellent overview from the Swift Package Index – M1 Pro and M1 Max Xcode Build and Test Benchmarks. |
Beta Was this translation helpful? Give feedback.
-
|
We are building all our artifacts for Here are some of the challenges that we faced:
However, we couldn't just use a test host to execute our tests inside Xcode. For example, numerous tests have assertions around frame and deep links whose behavior changes if we use test-host. We ended up creating an Please note that the
|
Beta Was this translation helpful? Give feedback.
-
|
Some other notes on this, as I've got this up and running on the ARM sim.
|
Beta Was this translation helpful? Give feedback.
-
|
Today I was looking at more of the edge cases and possibilities of unarchiving and updating ARM64 object files ( e.g. unarchiving ) in the Bazel rule that currently runs I noticed that there was a code path inside of the linker that will allow this behavior. Specifically if you pass Of course you'd still need to handle dynamic, because it failing at runtime. Possibly, dyld may have a similar code path.. If anyone has other approaches to handle dylibs at runtime ( e.g. as opposed to |
Beta Was this translation helpful? Give feedback.
-
|
Following the discussion above, we also have this in our xcconfig: This works for our iOS app and can give us more time to update all our dependencies to XCFramework with an arm64 iOS Simulator slice. This doesn't work so great for watchOS though. It seems like the Watch Simulator is very unhappy about this and refuses to install the built bundle because it thinks it's a WatchKit 1 app which it doesn't support anymore. I filed FB9768330 with a sample project because this happens on a brand new project too. It seems like there's currently no way to test watchOS apps except when building them natively for arm64, which I guess quite some projects currently can't do. |
Beta Was this translation helpful? Give feedback.
-
|
Has anyone identified if there's a similar thing you have to do to It is possible to decompile those back into |
Beta Was this translation helpful? Give feedback.
-
|
To support M1:
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
We are all pretty excited to start using Apple's new MacBook Pro devices with the M1 Pro and M1 Max chips, but the current landscape of building for the iOS simulator has quite a bit of extra complexity.
What are folks doing around support for local builds with the new M1 chips? Specifically around:
x86with the native ARM compilers in XcodeXCTestwhich will currently crash when givenx86binariesWould love to see some descriptions and any little snippets of wrapper scripts or pseudo-code that you can share to work around issues!
Beta Was this translation helpful? Give feedback.
All reactions