tauri icon indicating copy to clipboard operation
tauri copied to clipboard

[bug] can't use cargo tauri ios dev with recent Xcode upgrade

Open ctm opened this issue 3 months ago • 6 comments

Describe the bug

I'm no longer able to run tauri apps on an iPhone simulator by using cargo tauri ios dev. Running cargo tauri ios dev -vvv gives me:

** BUILD SUCCEEDED **

Archiving app...
Command line invocation:
    /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -destination "platform=iOS Simulator,name=iPhone 13" ARCHS=x86_64 -scheme wtf2_iOS -workspace /Users/ctm/playpens/tauri/wtf2/src-tauri/gen/apple/wtf2.xcodeproj/project.xcworkspace/ -sdk iphonesimulator -configuration debug -allowProvisioningUpdates archive -archivePath /Users/ctm/playpens/tauri/wtf2/src-tauri/gen/apple/build/wtf2_iOS

Build settings from command line:
    ARCHS = x86_64
    SDKROOT = iphonesimulator26.0

2025-09-30 14:45:11.162 xcodebuild[20044:449767] Writing error result bundle to /var/folders/mx/hdmj2f6n7pb06t986m403jmm0000gn/T/ResultBundle_2025-30-09_14-45-0011.xcresult
xcodebuild: error: Unable to find a device matching the provided destination specifier:
		{ platform:iOS Simulator, OS:latest, name:iPhone 13 }

	The requested device could not be found because no available devices matched the request.

	Available destinations for the "wtf2_iOS" scheme:
		{ platform:iOS, id:dvtdevice-DVTiPhonePlaceholder-iphoneos:placeholder, name:Any iOS Device }
		{ platform:iOS Simulator, id:dvtdevice-DVTiOSDeviceSimulatorPlaceholder-iphonesimulator:placeholder, name:Any iOS Simulator Device }
		{ platform:iOS Simulator, arch:x86_64, id:9A7C8815-D4F5-440B-8D4E-6547D12D7C40, OS:18.6, name:iPad (A16) }
		{ platform:iOS Simulator, arch:x86_64, id:A435AD52-26AF-4750-AEE4-86A27B2C70D5, OS:26.0, name:iPad (A16) }
		{ platform:iOS Simulator, arch:x86_64, id:8DD53DEA-4EA5-43EA-8503-808A1BBD008E, OS:18.6, name:iPad Air 11-inch (M3) }
		{ platform:iOS Simulator, arch:x86_64, id:17F50202-380E-4EF2-9FA9-0028839379F3, OS:26.0, name:iPad Air 11-inch (M3) }
		{ platform:iOS Simulator, arch:x86_64, id:8070F9FE-09C4-414D-8D91-B736DCE8AE11, OS:18.6, name:iPad Air 13-inch (M3) }
		{ platform:iOS Simulator, arch:x86_64, id:ECD0E7EB-46F2-4AB7-BCB3-F07391E928F3, OS:26.0, name:iPad Air 13-inch (M3) }
		{ platform:iOS Simulator, arch:x86_64, id:9E518A6C-CCD2-4C94-B57B-AA69165C23AE, OS:18.6, name:iPad Pro 11-inch (M4) }
		{ platform:iOS Simulator, arch:x86_64, id:D552AEC0-0A44-4505-81E5-FD2E2D76E17A, OS:26.0, name:iPad Pro 11-inch (M4) }
		{ platform:iOS Simulator, arch:x86_64, id:5E55BF20-FAC6-44F8-900C-59C8334DFADC, OS:18.6, name:iPad Pro 13-inch (M4) }
		{ platform:iOS Simulator, arch:x86_64, id:A0BCD3CF-76C8-489B-907E-9963BC4007CD, OS:26.0, name:iPad Pro 13-inch (M4) }
		{ platform:iOS Simulator, arch:x86_64, id:3B6F558E-846B-49D6-BEB8-16457E4824F6, OS:18.6, name:iPad mini (A17 Pro) }
		{ platform:iOS Simulator, arch:x86_64, id:24C8FB8E-2A99-4F8D-85D8-2C76B2F1DFA2, OS:26.0, name:iPad mini (A17 Pro) }
		{ platform:iOS Simulator, arch:x86_64, id:813081DF-1D8D-49F4-B966-871281B3B1E0, OS:18.6, name:iPhone 13 }
...

and I was totally baffled as to why iPhone 13 was mentioned, because I recently upgraded from an iPhone 13 to an iPhone 16e, so I thought that there was some sort of global state somewhere remembering my old phone. It turns out, the iPhone 13 is hardcoded in cargo-mobile2:

                if cfg!(target_arch = "x86_64") && sdk == "iphonesimulator" {
                    // on Intel we must force the ARCHS and destination when targeting the simulator
                    // otherwise xcodebuild tries to build arm64
                    // iPhone 13 seems like a good default target, old enough for every Xcode out there to have it?
                    cmd.args(["-destination", "platform=iOS Simulator,name=iPhone 13"])
                        .arg("ARCHS=x86_64");
                }

It was just a coincidence that what was hardcoded was the model that I formerly had. So, I thought I could fix it simply by adding an iPhone 13 simulator, but as you can see above, it failed, presumably due to the fact that the iPhone 13 can only run iOS 18, but the current iOS is 26 and the -destination doesn't specify the iOS version so it presumably defaults to latest, and then can't find a match.

Reproduction

On an Intel based Mac, use cargo create-tauri-app to create a demo app, then use cargo tauri ios init and cargo tauri ios dev without an iPhone connected. In case it matters, I chose Rust and Yew when asked. I believe you'll get the same failure at the Archiving app... stage. I also added -vvv to get enough debug output to see what command line options were being passed to xcodebuild.

Expected behavior

The demo app should be deployed on a simiulator.

Full tauri info output

cargo tauri info

[✔] Environment
    - OS: Mac OS 15.7.1 x86_64 (X64)
    ✔ Xcode Command Line Tools: installed
    ✔ Xcode: 26.0.1
    ✔ rustc: 1.90.0 (1159e78c4 2025-09-14)
    ✔ cargo: 1.90.0 (840b83a10 2025-07-30)
    ✔ rustup: 1.28.2 (e4f3ad6f8 2025-04-28)
    ✔ Rust toolchain: stable-x86_64-apple-darwin (overridden by environment variable RUSTUP_TOOLCHAIN)
    - node: 24.9.0
    - pnpm: 10.17.1
    - yarn: 1.22.19
    - npm: 11.6.0

[-] Packages
    - tauri 🦀: 2.8.5
    - tauri-build 🦀: 2.4.1
    - wry 🦀: 0.53.3
    - tao 🦀: 0.34.3
    - tauri-cli 🦀: 2.8.4

[-] Plugins
    - tauri-plugin-opener 🦀: 2.5.0

[-] App
    - build-type: bundle
    - CSP: unset
    - frontendDist: ../dist
    - devUrl: http://localhost:1420/

[-] iOS
    - Developer Teams: Clifford Matthews (ID: JAKF837UQ2)

Stack trace


Additional context

For me, this is a regression, but I don't know when it happened, because I regularly update my crates and Xcode and recently upgraded my phone, too. Again, for me, this is super low priority because I assume I can hack something into the -destination argument that will allow me move forward, but this error might surprise someone else, so I'll update this issue with what I find, even though my approach will probably be hack-and-slash rather than an acceptable PR (at least in the short term).

ctm avatar Sep 30 '25 21:09 ctm

I think it's worth mentioning this also happens when it is being run as following:

bun tauri ios dev 'iPhone 17'

I believe this results in a weird user-experience as the configuration is not being respected by cargo-mobile2.

petereon avatar Oct 09 '25 18:10 petereon

Using taur 2.9.1, I just tried creating a new tauri app doing the same as I did in the "Reproduction" section of this report: cargo create-tauri-app, choosing Rust and Yew, then running cargo tauri android init, cargo tauri ios init and cargo tauri ios dev (without and with a -vvv for more debug info). The failure is different from when I opened this issue:

** BUILD SUCCEEDED **

Archiving app...
Command line invocation:
    /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -destination "platform=iOS Simulator,name=iPhone Air" ARCHS=x86_64 -scheme ios-test_iOS -workspace /Users/ctm/playpens/tauri/ios-test/src-tauri/gen/apple/ios-test.xcodeproj/project.xcworkspace/ -sdk iphonesimulator -configuration debug -allowProvisioningUpdates archive -archivePath /Users/ctm/playpens/tauri/ios-test/src-tauri/gen/apple/build/ios-test_iOS

Build settings from command line:
    ARCHS = x86_64
    SDKROOT = iphonesimulator26.0

2025-10-22 13:00:35.018 xcodebuild[44230:14246132] [MT] DVTAssertions: Warning in IDEFrameworks/IDEFoundation/Execution/RunDestinations/IDERunDestinationManager.m:1085
Details:  There are multiple run destinations that support deployment for the current scheme; selecting anyObject: (
    "<IDERunDestination:'Any iOS Device' sdk:iphoneos26.0 variant:iphoneos arch:undefined_arch>",
    "<IDERunDestination:'Any iOS Simulator Device' sdk:iphonesimulator26.0 variant:iphonesimulator arch:undefined_arch>"
)
Object:   <IDERunDestinationManager: 0x600000782170>
Method:   -genericRunDestinationForRunDestination:scheme:schemeCommands:executionEnvironment:requiresSupportsArchiving:requiresDeploymentPlatformMatches:allowMultipleRunDestinationMatches:allowNoRunDestinationMatches:error:
Thread:   <_NSMainThread: 0x6000010e4340>{number = 1, name = main}
Please file a bug at https://feedbackassistant.apple.com with this warning message and any useful information you can provide.
ComputePackagePrebuildTargetDependencyGraph

Prepare packages

CreateBuildRequest

SendProjectDescription

CreateBuildOperation

ComputeTargetDependencyGraph
note: Building targets in dependency order
note: Target dependency graph (1 target)
    Target 'ios-test_iOS' in project 'ios-test' (no dependencies)

GatherProvisioningInputs

CreateBuildDescription

ExecuteExternalTool /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -v -E -dM -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS26.0.sdk -x c -c /dev/null

ExecuteExternalTool /Applications/Xcode.app/Contents/Developer/usr/bin/ibtool --version --output-format xml1

Build description signature: 32d4f597209b0e9e80856712ccfbe548
Build description path: /Users/ctm/Library/Developer/Xcode/DerivedData/ios-test-dueyfxhxfjwwzddippoktuaaptyc/Build/Intermediates.noindex/ArchiveIntermediates/ios-test_iOS/IntermediateBuildFilesPath/XCBuildData/32d4f597209b0e9e80856712ccfbe548.xcbuilddata
/Users/ctm/playpens/tauri/ios-test/src-tauri/gen/apple/ios-test.xcodeproj: error: Signing for "ios-test_iOS" requires a development team. Select a development team in the Signing & Capabilities editor. (in target 'ios-test_iOS' from project 'ios-test')
warning: None of the architectures in ARCHS (x86_64) are valid. Consider setting ARCHS to $(ARCHS_STANDARD) or updating it to include at least one value from VALID_ARCHS (arm64, x86_64) which is not in EXCLUDED_ARCHS (x86_64). (in target 'ios-test_iOS' from project 'ios-test')
note: Run script build phase 'Build Rust Code' will be run during every build because the option to run the script phase "Based on dependency analysis" is unchecked. (in target 'ios-test_iOS' from project 'ios-test')
** ARCHIVE FAILED **


The following build commands failed:
	Archiving workspace ios-test with scheme ios-test_iOS
(1 failure)
       Error [tauri_cli] failed to run iOS app: Failed to archive via `xcodebuild`: command ["xcodebuild"] exited with code 65

Here's my new full tauri info output:

% cargo tauri info

[✔] Environment
    - OS: Mac OS 15.7.1 x86_64 (X64)
    ✔ Xcode Command Line Tools: installed
    ✔ Xcode: 26.0.1
    ✔ rustc: 1.90.0 (1159e78c4 2025-09-14)
    ✔ cargo: 1.90.0 (840b83a10 2025-07-30)
    ✔ rustup: 1.28.2 (e4f3ad6f8 2025-04-28)
    ✔ Rust toolchain: stable-x86_64-apple-darwin (overridden by environment variable RUSTUP_TOOLCHAIN)
    - node: 24.10.0
    - pnpm: 10.17.1
    - yarn: 1.22.19
    - npm: 11.6.0

[-] Packages
    - tauri 🦀: 2.9.1
    - tauri-build 🦀: 2.5.1
    - wry 🦀: 0.53.5
    - tao 🦀: 0.34.5
    - tauri-cli 🦀: 2.9.1

[-] Plugins
    - tauri-plugin-opener 🦀: 2.5.0

[-] App
    - build-type: bundle
    - CSP: unset
    - frontendDist: ../dist
    - devUrl: http://localhost:1420/

[-] iOS
    - Developer Teams: Clifford Matthews (ID: JAKF837UQ2)

I hope that reporting this issue here (I can't reopen it myself) is the right thing to do. I considered opening a new issue, but I figure I can do that if it's preferred.

ctm avatar Oct 22 '25 19:10 ctm

I am also not able to dev a Tauri app on ipad after a few hours of trying to get it to work FWIW.

JohnAllen avatar Oct 29 '25 12:10 JohnAllen

Yeah I don't get it. Every other day tauri and xcode fail, it's such a fragile project.

AnthonyRonning avatar Oct 31 '25 13:10 AnthonyRonning

I am able to get it mostly running on ipad. App loads. Not totally sure what's happening because an AI agent is doing it.

JohnAllen avatar Nov 04 '25 17:11 JohnAllen

Any solution for this? I am facing same issue now.

Image
✔ Environment
    - OS: Mac OS 15.7.2 x86_64 (X64)
    ✔ Xcode Command Line Tools: installed
    ✔ Xcode: 16.2
    ✔ rustc: 1.91.1 (ed61e7d7e 2025-11-07)
    ✔ cargo: 1.91.1 (ea2d97820 2025-10-10)
    ✔ rustup: 1.28.2 (e4f3ad6f8 2025-04-28)
    ✔ Rust toolchain: stable-x86_64-apple-darwin (default)
    - node: 22.16.0
    - yarn: 1.22.22
    - npm: 10.9.2
    - bun: 1.3.0

[-] Packages
    - tauri 🦀: 2.9.3, (outdated, latest: 2.9.4)
    - tauri-build 🦀: 2.5.2, (outdated, latest: 2.5.3)
    - wry 🦀: 0.53.5
    - tao 🦀: 0.34.5
    - @tauri-apps/api  ⱼₛ: 2.9.0 (outdated, latest: 2.9.1)
    - @tauri-apps/cli  ⱼₛ: 2.9.4 (outdated, latest: 2.9.5)

[-] Plugins
    - tauri-plugin-store 🦀: 2.4.1
    - @tauri-apps/plugin-store  ⱼₛ: 2.4.1
    - tauri-plugin-deep-link 🦀: 2.4.5
    - @tauri-apps/plugin-deep-link  ⱼₛ: 2.4.5
    - tauri-plugin-http 🦀: 2.5.4
    - @tauri-apps/plugin-http  ⱼₛ: 2.5.4
    - tauri-plugin-fs 🦀: 2.4.4
    - @tauri-apps/plugin-fs  ⱼₛ: not installed!
    - tauri-plugin-opener 🦀: 2.5.2
    - @tauri-apps/plugin-opener  ⱼₛ: 2.5.2
    - tauri-plugin-shell 🦀: 2.3.3
    - @tauri-apps/plugin-shell  ⱼₛ: 2.3.3

[-] App
    - build-type: bundle
    - CSP: unset
    - frontendDist: ../dist
    - devUrl: http://localhost:1420/
    - framework: React
    - bundler: Rollup

[-] iOS
    - Developer Teams: None

melodyxpot avatar Dec 01 '25 20:12 melodyxpot