You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by GitBox <gi...@apache.org> on 2022/01/31 16:05:09 UTC

[GitHub] [cordova-ios] CodeWithOz opened a new issue #1221: unable to run ios simulator, possible regression due to simctl update

CodeWithOz opened a new issue #1221:
URL: https://github.com/apache/cordova-ios/issues/1221


   # 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/paultomkinson/Documents/textras/repos/textrasnow/node_modules/simctl/simctl.js:173:33)\n' +
     '    at getDeviceFromDeviceTypeId (/Users/paultomkinson/Documents/textras/repos/textrasnow/node_modules/ios-sim/src/lib.js:155:21)\n' +
     '    at /Users/paultomkinson/Documents/textras/repos/textrasnow/node_modules/ios-sim/src/lib.js:460:22\n' +
     '    at withInjectedEnvironmentVariablesToProcess (/Users/paultomkinson/Documents/textras/repos/textrasnow/node_modules/ios-sim/src/lib.js:269:3)\n' +
     '    at /Users/paultomkinson/Documents/textras/repos/textrasnow/node_modules/ios-sim/src/lib.js:457:7\n' +
     '    at tryParseBuffer (/Users/paultomkinson/Documents/textras/repos/textrasnow/node_modules/ios-sim/node_modules/bplist-parser/bplistParser.js:25:5)\n' +
     '    at /Users/paultomkinson/Documents/textras/repos/textrasnow/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')
   ```
   
   ## 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](https://github.com/ios-control/simctl/issues/27) 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
   <!-- Include all relevant information that might help understand and reproduce the problem -->
   cordova-ios 6.2.0 on m1 mac
   xcode 13
   
   
   ### Command or Code
   <!-- What command or code is needed to reproduce the problem? -->
   Try `cordova run --emulator --noprepare --nobuild --target="iPhone-13, 15.2" --debug` in a project.
   
   
   ### Environment, Platform, Device
   <!-- In what environment, on what platform or on which device are you experiencing the issue? -->
   m1 mac with xcode 13, trying to run my app on any simulator device
   
   
   
   ### Version information
   <!-- 
   What are relevant versions you are using?
   For example:
   Cordova: Cordova CLI, Cordova Platforms, Cordova Plugins 
   Other Frameworks: Ionic Framework and CLI version
   Operating System, Android Studio, Xcode etc.
   -->
   cordova 11
   cordova-ios 6.2.0
   
   
   
   ## Checklist
   <!-- Please check the boxes by putting an x in the [ ] like so: [x] -->
   
   - [x] I searched for existing GitHub issues
   - [x] I updated all Cordova tooling to most recent version
   - [x] I included all the necessary information above
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-ios] almercier commented on issue #1221: unable to run ios simulator, possible regression due to simctl update

Posted by GitBox <gi...@apache.org>.
almercier commented on issue #1221:
URL: https://github.com/apache/cordova-ios/issues/1221#issuecomment-1027249718


   Judging by the thread on the [bug report on simct](https://github.com/ios-control/simctl/issues/30)l, it seems like it might be an easy fix. Hoping it gets fixed quickly.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-ios] timbru31 commented on issue #1221: unable to run ios simulator, possible regression due to simctl update

Posted by GitBox <gi...@apache.org>.
timbru31 commented on issue #1221:
URL: https://github.com/apache/cordova-ios/issues/1221#issuecomment-1025944581


   /cc @shazron 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-ios] dpogue commented on issue #1221: unable to run ios simulator, possible regression due to simctl update

Posted by GitBox <gi...@apache.org>.
dpogue commented on issue #1221:
URL: https://github.com/apache/cordova-ios/issues/1221#issuecomment-1027195470


   There was [a report](https://github.com/apache/cordova-ios/issues/1219) that simctl was causing npm audit warnings on cordova-ios due to a vulnerable version of shelljs. This led to an [update](https://github.com/ios-control/simctl/issues/27) 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.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-ios] antares-farias commented on issue #1221: unable to run ios simulator, possible regression due to simctl update

Posted by GitBox <gi...@apache.org>.
antares-farias commented on issue #1221:
URL: https://github.com/apache/cordova-ios/issues/1221#issuecomment-1030253369


   what works for me was to directly install in the project the previews version of the simctl
   
   npm install simctl@2.0.0


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-ios] antares-farias commented on issue #1221: unable to run ios simulator, possible regression due to simctl update

Posted by GitBox <gi...@apache.org>.
antares-farias commented on issue #1221:
URL: https://github.com/apache/cordova-ios/issues/1221#issuecomment-1027189538


   This also happened to me this past Friday this was working fine and on Monday, I get that exact same error even recloning the repo and reinstalling everything.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-ios] CodeWithOz commented on issue #1221: unable to run ios simulator, possible regression due to simctl update

Posted by GitBox <gi...@apache.org>.
CodeWithOz commented on issue #1221:
URL: https://github.com/apache/cordova-ios/issues/1221#issuecomment-1026314285


   @timbru31 @shazron what would be the "fast" way to return to using the version of `simctl` that doesn't contain the regression? I've tried cloning each dependency and updating the files but installing the final modified cordova-ios is giving an error that the cordova-ios platform failed to fetch.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-ios] almercier commented on issue #1221: unable to run ios simulator, possible regression due to simctl update

Posted by GitBox <gi...@apache.org>.
almercier commented on issue #1221:
URL: https://github.com/apache/cordova-ios/issues/1221#issuecomment-1027186782


   You can force cordova-ios to use the previous version of simctl as a temporary workaround.
   `npm un simctl && npm i simctl@2.0.0 -E -D`
   
   I tried using npm 8's [overrides](https://docs.npmjs.com/cli/v8/configuring-npm/package-json#overrides) feature, but couldn't seem to get it working. Most likely because npm audit keeps ignoring the override and installing 2.0.1


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-ios] shazron commented on issue #1221: unable to run ios simulator, possible regression due to simctl update

Posted by GitBox <gi...@apache.org>.
shazron commented on issue #1221:
URL: https://github.com/apache/cordova-ios/issues/1221#issuecomment-1033561393


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


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-ios] CodeWithOz commented on issue #1221: unable to run ios simulator, possible regression due to simctl update

Posted by GitBox <gi...@apache.org>.
CodeWithOz commented on issue #1221:
URL: https://github.com/apache/cordova-ios/issues/1221#issuecomment-1026327690


   To be clear what I mean is that I forked cordova-ios and updated the `package.json` to use:
   ```json
   ...
       "ios-sim": "github:CodeWithOz/ios-sim#fix-pin-simctl",
   ...
   ```
   
   and the `package-lock.json` now has:
   ```json
   ...
           "ios-sim": "github:CodeWithOz/ios-sim#fix-pin-simctl",
   ...
       "node_modules/ios-sim": {
         "version": "9.0.0",
         "resolved": "git+ssh://git@github.com/CodeWithOz/ios-sim.git#7471195884b9596e73934ab8a07c9836417cd35f",
         "license": "Apache-2.0",
         "dependencies": {
           "@oclif/command": "^1.5.18",
           "@oclif/config": "^1.13.3",
           "@oclif/errors": "^1.2.2",
           "@oclif/plugin-help": "^2.2.1",
           "bplist-parser": "^0.2.0",
           "debug": "^4.1.1",
           "nopt": "^4.0.1",
           "plist": "^3.0.1",
           "simctl": "2.0.0"
         },
         "bin": {
           "ios-sim": "bin/ios-sim"
         },
         "engines": {
           "node": ">=8"
         }
       },
   ...
       "ios-sim": {
         "version": "git+ssh://git@github.com/CodeWithOz/ios-sim.git#7471195884b9596e73934ab8a07c9836417cd35f",
         "from": "ios-sim@CodeWithOz/ios-sim#fix-pin-simctl",
         "requires": {
           "@oclif/command": "^1.5.18",
           "@oclif/config": "^1.13.3",
           "@oclif/errors": "^1.2.2",
           "@oclif/plugin-help": "^2.2.1",
           "bplist-parser": "^0.2.0",
           "debug": "^4.1.1",
           "nopt": "^4.0.1",
           "plist": "^3.0.1",
           "simctl": "2.0.0"
         },
         "dependencies": {
           "nopt": {
             "version": "4.0.3",
             "resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.3.tgz",
             "integrity": "sha512-CvaGwVMztSMJLOeXPrez7fyfObdZqNUK1cPAEzLHrTybIua9pMdmmPR5YwtfNftIOMv3DPUhFaxsZMNTQO20Kg==",
             "requires": {
               "abbrev": "1",
               "osenv": "^0.1.4"
             }
           }
         }
       },
   ...
   ```
   
   I add the platform using `cordova platform add -verbose https://github.com/CodeWithOz/cordova-ios#fix-ios-sim` and get this as part of the error:
   ```
   Using cordova-fetch for https://github.com/CodeWithOz/cordova-ios#fix-ios-sim
   fetch: Installing https://github.com/CodeWithOz/cordova-ios#fix-ios-sim to /Users/{user}/Documents/{project}
   Running command: npm install https://github.com/CodeWithOz/cordova-ios#fix-ios-sim --save-dev
   Command finished with error code 1: npm install,https://github.com/CodeWithOz/cordova-ios#fix-ios-sim,--save-dev
   Failed to fetch platform https://github.com/CodeWithOz/cordova-ios#fix-ios-sim
   Probably this is either a connection problem, or platform spec is incorrect.
   Check your connection and platform name/version/URL.
   CordovaError: Error: npm: Command failed with exit code 1 Error output:
   sh: oclif-dev: command not found
   npm ERR! premature close
   ```
   
   It seems the relevant line is `Command finished with error code 1: npm install,https://github.com/CodeWithOz/cordova-ios#fix-ios-sim,--save-dev`, so when I ran `npm i` directly in the cordova-ios folder I get a stream of errors like this (abbreviated because it's really really long):
   ```
   ...
   npm WARN tar ENOENT: no such file or directory, lstat '/Users/{user}/Documents/cordova-ios/node_modules/.staging/rxjs-756692a8/src/operator'
   npm WARN tar ENOENT: no such file or directory, open '/Users/{user}/Documents/cordova-ios/node_modules/.staging/rxjs-756692a8/src/operators/zipAll.ts'
   npm WARN tar ENOENT: no such file or directory, open '/Users/{user}/Documents/cordova-ios/node_modules/.staging/rxjs-756692a8/_esm2015/LICENSE.txt'
   ...
   ```
   
   Any ideas on what the solution could be for me?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org