unable to run ios simulator, possible regression due to simctl update
See original GitHub issueBug Report
I’m no longer able to use cordova run
to start my app with the iphone simulator. This was working on Saturday and it’s no longer working today. The error message is:
Error: Unhandled error. ('[ios-sim] SyntaxError: Unexpected token u in JSON at position 0\n' +
' at JSON.parse (<anonymous>)\n' +
' at Object.list (/Users/{user}/Documents/{project}/node_modules/simctl/simctl.js:173:33)\n' +
' at getDeviceFromDeviceTypeId (/Users/{user}/Documents/{project}/node_modules/ios-sim/src/lib.js:155:21)\n' +
' at /Users/{user}/Documents/{project}/node_modules/ios-sim/src/lib.js:460:22\n' +
' at withInjectedEnvironmentVariablesToProcess (/Users/{user}/Documents/{project}/node_modules/ios-sim/src/lib.js:269:3)\n' +
' at /Users/{user}/Documents/{project}/node_modules/ios-sim/src/lib.js:457:7\n' +
' at tryParseBuffer (/Users/{user}/Documents/{project}/node_modules/ios-sim/node_modules/bplist-parser/bplistParser.js:25:5)\n' +
' at /Users/{user}/Documents/{project}/node_modules/ios-sim/node_modules/bplist-parser/bplistParser.js:33:7\n' +
' at FSReqCallback.readFileAfterClose [as oncomplete] (internal/fs/read_file_context.js:63:3)\n')
I’ve also created an issue about this in the simctl
repo.
Problem
simctl
now throws an error when trying to get the details of the specified target device, as shown in that error message. The problem appears related to the changes discussed in this simctl
issue which led to updating shelljs
to fix a security vulnerability.
What is expected to happen?
cordova run
completes without errors, which was happening as recently as 2 days ago.
What does actually happen?
See explanation above.
Information
cordova-ios 6.2.0 on m1 mac xcode 13
Command or Code
Try cordova run --emulator --noprepare --nobuild --target="iPhone-13, 15.2" --debug
in a project.
Environment, Platform, Device
m1 mac with xcode 13, trying to run my app on any simulator device
Version information
cordova 11 cordova-ios 6.2.0
Checklist
- I searched for existing GitHub issues
- I updated all Cordova tooling to most recent version
- I included all the necessary information above
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (3 by maintainers)
Top GitHub Comments
There was a report that simctl was causing npm audit warnings on cordova-ios due to a vulnerable version of shelljs. This led to an update to simctl to pull in the latest version of shelljs, which seems to have breaking changes around how it handles stdio.
Installing cordova-ios as of Sunday will pull in the latest version of simctl, which currently has a non-vulnerable, but also non-working version of shelljs.
simctl@2.0.2 was just published with a fix. Sorry about this, I was away (public holidays)