apache / cordova-ios

Apache Cordova iOS
https://cordova.apache.org/
Apache License 2.0
2.16k stars 986 forks source link

`cordova run --list` returns "iPhones 4S, 9.0" simulator, using "iPhone-4s" as target fails with "xcodebuild: error: Unable to find a destination matching the provided destination specifier: { platform:iOS Simulator, OS:latest, name:iPhone 4s }" #601

Closed janpio closed 6 months ago

janpio commented 5 years ago

Bug Report

Problem

What is expected to happen?

cordova run --emulator should be able to use the simulators returned from cordova run --list to build and start the app.

What does actually happen?

On Xcode 9.3 and 9.4 Travis CI images, a returned simulator can not be used to build:

https://travis-ci.org/apache/cordova-paramedic/jobs/519983896 https://travis-ci.org/apache/cordova-paramedic/jobs/519983897

cordova-ios returns an iPhones 4S, 9.0 as a valid simulator when executing cordova run --list --emulator (which is selected by paramedic via | grep ^iPhone | tail -n1).

This is then used to emulate the app (build + run) with this command:

$ cordova run ios --no-telemetry --no-update-notifier --target iPhone-4s --emulator
Building for "iPhone 4s" Simulator (com.apple.CoreSimulator.SimDeviceType.iPhone-4s, iPhone-4s)
Building project: /private/var/folders/bb/n7t3rs157850byt_jfdcq9k80000gn/T/tmp-1900Akip1xq2M0zM/platforms/ios/HelloCordova.xcworkspace
    Configuration: Debug
    Platform: emulator
    Target: iPhone 4s
Running command: xcodebuild -workspace HelloCordova.xcworkspace -scheme HelloCordova -configuration Debug -sdk iphonesimulator -destination platform=iOS Simulator,name=iPhone 4s build ...

Unfortunately this fails when xcodebuild actually tries to build:

xcodebuild: error: Unable to find a destination matching the provided destination specifier:
        { platform:iOS Simulator, OS:latest, name:iPhone 4s }
    Available destinations for the "HelloCordova" scheme:
        { platform:iOS Simulator, id:D56CF125-0398-405C-BCAD-7CD5C8DE9C81, OS:10.3.1, name:iPad (5th generation) }
        ...

Information

Version information

CLI 9, cordova-ios 5.0.0

Checklist

erisu commented 6 months ago

The ticket will be closed as the issue is no longer present.

I have tested this with the latest cordova-ios release (7.0.1).

Since the ticket was created, there have been a few changes:

Taking into account these changes, I tested with the following:

$ cordova run ios --list
$ cordova run ios --target=iPhone-6s

We can confirm that iPhone-6s is listed:

cordova run ios --list
Available iOS Devices:
Available iOS Simulators:
    iPhone-13-mini, 17.2
    iPhone-SE-3rd-generation, 17.2
    iPhone-SE-3rd-generation, 17.0
    iPhone-14-Pro, 17.0
    iPhone-14-Pro-Max, 17.0
    iPad-mini-6th-generation, 17.2
    iPad-mini-6th-generation, 17.0
    iPad-Pro-12-9-inch-6th-generation-8GB, 17.2
    iPad-Pro-12-9-inch-6th-generation-8GB, 17.0
    iPhone-XR, 17.2
    iPhone-15, 17.2
    iPhone-15, 17.0
    iPhone-15-Plus, 17.2
    iPhone-15-Plus, 17.0
    iPhone-15-Pro, 17.2
    iPhone-15-Pro, 17.0
    iPhone-15-Pro-Max, 17.2
    iPhone-15-Pro-Max, 17.0
    iPad-Air-5th-generation, 17.2
    iPad-10th-generation, 17.2
    iPad-Pro-11-inch-4th-generation-8GB, 17.2
    iPhone-14, 16.1
    iPhone-X, 16.1
    iPad-Pro-12-9-inch-6th-generation-16GB, 17.0
    iPhone-6s, 15.5
    iPhone-SE, 15.5

We also confirmed that the build targets iPhone-6s and deploys to an iPhone-6s simulator:

cordova run ios --target=iPhone-6s
List simulator targets
Building for "iPhone 6s" Simulator (com.apple.CoreSimulator.SimDeviceType.iPhone-6s, iPhone-6s).
...
Target: iPhone 6s
...