question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

unable to run ios simulator, possible regression due to simctl update

See original GitHub issue

Bug 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:open
  • Created 2 years ago
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
dpoguecommented, Feb 1, 2022

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.

2reactions
shazroncommented, Feb 9, 2022

simctl@2.0.2 was just published with a fix. Sorry about this, I was away (public holidays)

Read more comments on GitHub >

github_iconTop Results From Across the Web

simctl not working in Xcode 7.0 an… | Apple Developer Forums
In Xcode 7.0, I have not been able to install or uninstall apps with simctl. And there is a typo in the simctl...
Read more >
Unable to run iOS app on iOS 15 Simulator - Stack Overflow
The app crashes immediately when the simulator attempts to run it. ... on the device 'iOS 15.5 (19F70) - iPhone 13': simctl returned...
Read more >
VS for Mac 2022 Preview 7 can't launch iOS app in debug mode
When try to run my app on iphone simulator 15.4 i get “error HE0042: Could not launch the app 'xxx' on the device...
Read more >
iOS Simulator - Expo Documentation
Open up the Mac App Store, search for Xcode, and hit install (or update if you have it already). If you're unable to...
Read more >
How to UI Test Push Notifications and Universal Links in the ...
Getting Closer. As of Xcode 11.4, users are finally able to test Push Notifications via the iOS Simulator. We can send push notifications...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found