fix: run target with and without hyphens#1596
Conversation
- GitHub actions was giving an error about this variable: `'val' is never reassigned. Use 'const' instead`
dpogue
left a comment
There was a problem hiding this comment.
If you are running on an Apple Silicon-based Mac, I think you will have double versions of older simulators because they used to be universal builds with both the arm64 and x86_64 versions. Xcode 26 (on Apple Silicon) will only pull down the arm64 simulators going forward.
Unfortunately, I don't know if there's a good way to differentiate when trying to launch one...
Co-authored-by: Darryl Pogue <darryl@dpogue.ca>
Do you think, this is why I had cordova run ios --target="iPhone 16 Pro, 18.5"But gives a warning: --- xcodebuild: WARNING: Using the first of multiple matching destinations:
{ platform:iOS Simulator, arch:arm64, id:E8DF4860-A689-418F-A524-90AA745E9406, OS:18.5, name:iPhone 16 Plus }
{ platform:iOS Simulator, arch:x86_64, id:E8DF4860-A689-418F-A524-90AA745E9406, OS:18.5, name:iPhone 16 Plus }But when I run with hypens, it will not work. Command: cordova run ios --target="iPhone-16-Pro, 18.5"Error: xcodebuild: error: Unable to find a device matching the provided destination specifier:
{ platform:iOS Simulator, OS:18.5, name:iPhone 16 Pro }
The requested device could not be found because multiple devices matched the request. (
"<DVTiPhoneSimulator: 0xa8c898000> {\n\t\tSimDevice: iPhone 16 Pro (E4D9D5C2-661E-4AA7-B31D-0D5079C002BD, iOS 18.5, Booted)\n}",
"<DVTiPhoneSimulator: 0xa8c898280> {\n\t\tSimDevice: iPhone 16 Pro (0C7B1CB0-BED0-4DE2-A6CC-FC4CD471A114, iOS 18.5, Shutdown)\n}"
) |
You are completely right, I see now in the warning, that the arch is one time listed with |
I guess the "correct" way to do this would be to detect the architecture we're currently running on and try to find a simulator that matches that architecture, but I don't know for sure if that's always going to be better. I am confused about why you get different results with spaces vs dashes, because it should be translating them to the same thing... |
Me too, but I saw now, when running a target without hyphens: cordova run ios --target="iPhone 16 Pro, 18.5"The warning was about I will fix this. |
- Enhance simulator build process by resolving device UDID and updating xcodebuild arguments
- GitHub actions complained about trailing spaces
|
I changed 3 things:
|
cordova run ios --target="iPhone-16-Pro, 18.5"did not workiPhone-16-Pro, 18.5andiPhone 16 Pro, 18.5Platforms affected
Motivation and Context
I wanted to test in two simulators:
When I do
cordova run ios --list, I get:When I tried to run
cordova run ios --target="iPhone-16-Pro, 18.5"it always failed with this log:
When I tried to use the UUID like the following:
it says:
than it builds, but saying at the end
I asked Copilot in Visual Studio Code, what's happening and it changed the two files added to this PR. After that, the following do work:
I noticed that I had
iPhone 16 Pro, 18.5two times installed in XCode, but think, this was not the root cause of the problem. When I run this PR with twoiPhone 16 Pro, 18.5installed:cordova run ios --target="iPhone-16-Pro, 18.5"I get the following natural error:
xcodebuild: error: Unable to find a device matching the provided destination specifier: { platform:iOS Simulator, OS:18.5, name:iPhone 16 Pro } The requested device could not be found because multiple devices matched the request. ( "<DVTiPhoneSimulator: 0x83286c000> {\n\t\tSimDevice: iPhone 16 Pro (E4D9D5C2-661E-4AA7-B31D-0D5079C002BD, iOS 18.5, Booted)\n}", "<DVTiPhoneSimulator: 0x83286c280> {\n\t\tSimDevice: iPhone 16 Pro (0C7B1CB0-BED0-4DE2-A6CC-FC4CD471A114, iOS 18.5, Shutdown)\n}" )It shows the error because of
multiple devices matched the request. I reviewed my console history and didn't find this error, before applying the changes.Description
Testing
Checklist
(platform)if this change only applies to one platform (e.g.(android))