Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Finding first ios simulator #265

Merged
merged 1 commit into from
Sep 15, 2023
Merged

fix: Finding first ios simulator #265

merged 1 commit into from
Sep 15, 2023

Conversation

breautek
Copy link
Contributor

Platforms affected

Motivation and Context

simulator lists has a tab \t, so the ^ start of string regex was failing to find anything.

fixes #264

Description

Testing

Checklist

  • I've run the tests to see all new and existing tests pass
  • I added automated test coverage as appropriate for this change
  • Commit is prefixed with (platform) if this change only applies to one platform (e.g. (android))
  • If this Pull Request resolves an issue, I linked to the issue in the text above (and used the correct keyword to close issues using keywords)
  • I've updated the documentation if necessary

@breautek breautek requested a review from erisu September 14, 2023 18:15
@breautek breautek merged commit 1f5c34b into master Sep 15, 2023
12 of 22 checks passed
@breautek breautek deleted the fix-sim-auto-select branch September 15, 2023 00:05
@svenemtell
Copy link

Thanks @breautek!
It now works without using the --target flag, but I get a couple of Error messages, see log excerpt below.

...
---------------------------------------------------------
4. Run (Jasmine) tests...
... locally
---------------------------------------------------------
cordova-paramedic: running tests locally
cordova-paramedic: Choosing Target for iOS
running:
    cordova run ios --list --emulator --no-telemetry --no-update-notifier
Avaliable Emulators:
Available iOS Simulators:
        iPhone-SE-3rd-generation, 16.4
        iPad-Air-5th-generation, 16.4
        iPad-mini-6th-generation, 16.4
        iPhone-14, 16.4
        iPhone-14-Plus, 16.4
        iPhone-14-Pro, 16.4
        iPhone-14-Pro-Max, 16.4
        iPad-10th-generation, 16.4
        iPad-Pro-11-inch-4th-generation-8GB, 16.4
        iPad-Pro-12-9-inch-6th-generation-8GB, 16.4
Filtering for Targeted Emulator: /^iPhone/
Unable to find requested simulator, falling back to the first available!
running:
    (xcrun xctrace list devices || instruments -s devices) 2>&1 | grep ^iPhone
$ (xcrun xctrace list devices || instruments -s devices) 2>&1 | grep ^iPhone
iPhone 14 Simulator (16.4) (3424276F-20AD-4EBB-93FD-74D868B0673F)
iPhone 14 Plus Simulator (16.4) (9EB10B98-76B8-44F5-8CEE-79AF4A9AEA30)
iPhone 14 Pro Simulator (16.4) (129B73AE-52A2-48C3-BAF8-3BC7FFEAD288)
iPhone 14 Pro Max Simulator (16.4) (00F6199B-13D2-46DF-8FC2-715D16EF04D7)
iPhone SE (3rd generation) Simulator (16.4) (19C62B77-CE5E-4CE0-B723-4E02591EEEFD)
Error: No simulator found.
cordova-paramedic: Setting required permissions.
cordova-paramedic: running command cordova run ios --no-telemetry --no-update-notifier  --target "iPhone-SE-3rd-generation, 16.4" --emulator
$ cordova run ios --no-telemetry --no-update-notifier  --target "iPhone-SE-3rd-generation, 16.4" --emulator
cordova-paramedic: waiting for test results
List simulator targets
Building for "iPhone SE (3rd generation)" Simulator (com.apple.CoreSimulator.SimDeviceType.iPhone-SE-3rd-generation, iPhone-SE-3rd-generation).
Building project: /private/var/folders/02/k2jz79g95rl4xyz2h6wp03b80000gn/T/tmp-74830-CARfYfuUKWG3/platforms/ios/HelloCordova.xcworkspace
        Configuration: Debug
        Platform: emulator
        Target: iPhone SE (3rd generation)
2023-09-15 09:01:14.657 xcodebuild[75301:2380511] DVTCoreDeviceEnabledState: DVTCoreDeviceEnabledState_Disabled set via user default (DVTEnableCoreDevice=disabled)
Command line invocation:
    /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -workspace HelloCordova.xcworkspace -scheme HelloCordova -configuration Debug -sdk iphonesimulator -destination "platform=iOS Simulator,name=iPhone SE (3rd generation)" build SYMROOT=/private/var/folders/02/k2jz79g95rl4xyz2h6wp03b80000gn/T/tmp-74830-CARfYfuUKWG3/platforms/ios/build

User defaults from command line:
    IDEPackageSupportUseBuiltinSCM = YES

Build settings from command line:
    SDKROOT = iphonesimulator16.4
    SYMROOT = /private/var/folders/02/k2jz79g95rl4xyz2h6wp03b80000gn/T/tmp-74830-CARfYfuUKWG3/platforms/ios/build

--- xcodebuild: WARNING: Using the first of multiple matching destinations:
{ platform:iOS Simulator, id:19C62B77-CE5E-4CE0-B723-4E02591EEEFD, OS:16.4, name:iPhone SE (3rd generation) }
{ platform:iOS Simulator, id:19C62B77-CE5E-4CE0-B723-4E02591EEEFD, OS:16.4, name:iPhone SE (3rd generation) }
Prepare packages


...


---------------------------------------------------------
6. Collect data and clean up
---------------------------------------------------------
Completed tests at 9:01:39 AM
Collecting logs for the devices.
Error: Failed to find the ID of the simulator
Uninstalling the app.
cordova-paramedic: Running command: xcrun simctl uninstall undefined io.cordova.hellocordova
$ xcrun simctl uninstall undefined io.cordova.hellocordova
Invalid device: undefined
Error: Failed to uninstall the app
Error: Error code: 148
cordova-paramedic: App uninstall timed out!
cordova-paramedic: Killing the emulator process.
Running the following command:
    killall -9 "Simulator" "iOS Simulator"
$ killall -9 "Simulator" "iOS Simulator"
local-server: killing local file transfer server if it's up...
cordova-paramedic: Deleting the application: /var/folders/02/k2jz79g95rl4xyz2h6wp03b80000gn/T/tmp-74830-CARfYfuUKWG3
/Volumes/source/cordova-plugin-gaudiamus
Finished with exit code 0

@breautek
Copy link
Contributor Author

Yah, I did experience that issue during testing/using where it only really works if there are no simulators running.

I think there's another, perhaps similar issue somewhere's else in paramedic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to find requested simulator (iOS) without --target flag
3 participants