Closed mrguiman closed 1 month ago
I had this error with the simulator a while back, check versions of your Xcode application and also the CLI tools Update if it's an old version If not, go to `Xcode Settings -> Platforms -> {Choose the iOS mobile simulator} and delete and download again.
I am just trying to help, I don't know if this is the silver bullet for your issue here
Unfortunately it isn't, I appreciate that the error can come from multiple sources though, but in this case I've tried installing countless other platforms and changing the deployment target within the xcodeproject without success
Quick update with new results:
I'm still investigating on my previous suspicion that the arch64-sim
might be the culprit somehow, because i had a feeling that the arm64-apple-ios13.0-simulator-sim
target is assembled together and that the "-sim" suffix shouldn't be there. (I might be missing some important knowledge here though).
So what i did was manually invoke the command behind cargo tauri ios dev
, but replacing the "arm64-sim" arch with just arm64:
/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -scheme tauri2-test_iOS -workspace /Users/gman/code/tauri2-test/src-tauri/gen/apple/tauri2-test.xcodeproj/project.xcworkspace/ -sdk iphonesimulator -configuration debug -arch arm64 -allowProvisioningUpdates build
This requires a few changes to the project, because the arm64 arch is set as excluded for the iphonesimulator. Removing this exclusion and running the command again does produce a different result, and as expected, the target now is arm64-apple-ios13.0-simulator
and I no longer have the previous error, but something new:
thread 'main' panicked at /Users/gman/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tauri-cli-2.0.0-beta.20/src/mobile/mod.rs:282:6:
failed to read CLI options: Error when opening the TCP socket: Connection refused (os error 61)
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Command PhaseScriptExecution failed with a nonzero exit code
Unfortunately I'm suffering from a severe lack of knowledge here and running entirely off of assumptions (this might very well be a red herring), so any insight would be appreciated.
So after talking to @lucasfernog, we figured out a way to run inside the simulator, from xcode, by running cargo tauri ios dev --open
Thank you for having a look and providing information !
For future reference, the cleanest way I found to go about this would be to:
cargo tauri ios dev --open
This branch provides a working example.
Describe the bug
Trying to run a tauri 2 app on ios using
cargo tauri ios dev
fails when adding an extension to the app, with the following error:I haven't been able to track down the origin of the error, although I have successfuly been able to build an ipa out of a similar project. Changing the deployment target to a higher iOS version produces a similar result. The target triplet seems a bit off as I wasn't able to identify similar targets on other projects
Reproduction
This should produce the same output. Please note that gen/apple/project.yml has been modified to introduce the app extension, and gen/apple/tauri2-test_iOS_shareExt has been commited as a basic boilerplate for a share extension (copied from an extension generated by xcode) but similar behavior happens when adding the extension through xcode itself.
Expected behavior
iOS apps built with tauri should be able to build with extensions to provide more capabilities and access to the iOS platform.
Full
tauri info
outputStack trace
No response
Additional context
Playing around with the project's Build Settings around xcode, if I set ARCHS to by ARCH_STANDARD on the project and both targets the "arm64-sim" architecture still seems to be pushed by the command line, as explicited by part of the output log:
but raises an interesting warning which again points to the "arch64-sim" arch being fishy: