Giter VIP home page Giter VIP logo

Comments (10)

davlhd avatar davlhd commented on June 29, 2024 2

The problem is the output of xcrun simctl list --json:

Thats a runtime:

  "runtimes" : [
    {
      "bundlePath" : "\/Library\/Developer\/CoreSimulator\/Profiles\/Runtimes\/iOS 11.3.simruntime",
      "availabilityError" : "",
      "buildversion" : "15E217",
      "availability" : "(available)",
      "isAvailable" : true,
      "identifier" : "com.apple.CoreSimulator.SimRuntime.iOS-11-3",
      "version" : "11.3",
      "name" : "iOS 11.3"
    },

Those are devices:

  "devices" : {
    "iOS 12.1" : [
      {
        "availability" : "(available)",
        "state" : "Shutdown",
        "isAvailable" : true,
        "name" : "iPhone 5s",
        "udid" : "DA69902D-B4FC-46E3-9465-D48D0C04B5BB",
        "availabilityError" : ""
      },

vs.

 "devices" : {
    "com.apple.CoreSimulator.SimRuntime.iOS-11-4" : [
      {
        "availability" : "(unavailable, runtime profile not found)",
        "state" : "Shutdown",
        "isAvailable" : false,
        "name" : "iPhone 5s",
        "udid" : "43416A47-F7D3-4F57-8729-776F22323D88",
        "availabilityError" : "runtime profile not found"
      },

findRuntimesGroupByDeviceProperty tries to find the runtimes by using the name property. In the second case it's not grouped by the name its grouped by identifier.

I do not know enough about this project to create a PR. But a quick fix is to change the findRuntimesGroupByDeviceProperty function inside /usr/local/lib/node_modules/ios-sim/src/lib.js

from
available_runtimes[ runtime.name ] = (runtime.availability === '(available)');
to
available_runtimes[ runtime.identifier] = (runtime.availability === '(available)');

David

Edit: Just for clarity: the second device comes from a different machine that groups them by identifier.
They use 2 different Xcode versions.

from ios-sim.

ejerskov avatar ejerskov commented on June 29, 2024 1

Thanks @davlhd!

With your fix I now get a list of devices when running ios-sim showdevicetypes.
However, when I run ionic cordova emulate ios --list I still get an empty list - do you know why?
I have tried to remove and add the ios platform afterwards.

from ios-sim.

shazron avatar shazron commented on June 29, 2024

Should be fixed in v8.0 (upcoming release)

from ios-sim.

ejerskov avatar ejerskov commented on June 29, 2024

Thank you for the quick respons @shazron !
Any ETA on v8.0? Or can I manually downgrade to get it to work until?

from ios-sim.

shazron avatar shazron commented on June 29, 2024

Already released.

from ios-sim.

ejerskov avatar ejerskov commented on June 29, 2024

Hi @shazron
I've just updated by running
npm install -g ios-sim

ios-sim --version returns 8.0.0

But ios-sim showdevicetypes still returns an empty list

Im I doing something wrong?

from ios-sim.

shazron avatar shazron commented on June 29, 2024

Hmm I'm getting the right devices with ios-sim 8. However I don't have iOS 11 Sims installed maybe that's why:

$ ios-sim showdevicetypes
Apple-TV-1080p, tvOS 12.1
Apple-TV-4K-4K, tvOS 12.1
Apple-TV-4K-1080p, tvOS 12.1
Apple-Watch-Series-2-38mm, watchOS 5.1
Apple-Watch-Series-2-42mm, watchOS 5.1
Apple-Watch-Series-3-38mm, watchOS 5.1
Apple-Watch-Series-3-42mm, watchOS 5.1
Apple-Watch-Series-4-40mm, watchOS 5.1
Apple-Watch-Series-4-44mm, watchOS 5.1
iPhone-5, 10.3
iPhone-5, 9.3
iPhone-5s, 10.3
iPhone-5s, 12.1
iPhone-5s, 9.3
iPhone-6, 10.3
iPhone-6, 12.1
iPhone-6, 9.3
iPhone-6-Plus, 10.3
iPhone-6-Plus, 12.1
iPhone-6-Plus, 9.3
iPhone-6s, 10.3
iPhone-6s, 12.1
iPhone-6s, 9.3
iPhone-6s-Plus, 10.3
iPhone-6s-Plus, 12.1
iPhone-6s-Plus, 9.3
iPhone-7, 10.3
iPhone-7, 12.1
iPhone-7-Plus, 10.3
iPhone-7-Plus, 12.1
iPhone-SE, 10.3
iPhone-SE, 12.1
iPad-Air, 10.3
iPad-Air, 12.1
iPad-Air, 9.3
iPad-Air-2, 10.3
iPad-Air-2, 12.1
iPad-Air-2, 9.3
iPad--5th-generation-, 10.3
iPad--5th-generation-, 12.1
iPad-Pro--9-7-inch-, 10.3
iPad-Pro, 10.3
iPad-Pro--12-9-inch---2nd-generation-, 10.3
iPad-Pro--12-9-inch---2nd-generation-, 12.1
iPad-Pro--10-5-inch-, 10.3
iPad-Pro--10-5-inch-, 12.1
iPhone-8, 12.1
iPhone-8-Plus, 12.1
iPhone-X, 12.1
iPad-Pro--9-7-inch-, 12.1
iPad-Pro--9-7-inch-, 9.3
iPad-Pro, 12.1
iPad-Retina, 9.3
iPad--6th-generation-, 12.1
iPhone-XS, 12.1
iPhone-XS-Max, 12.1
iPhone-XR, 12.1
iPad-Pro--11-inch-, 12.1
iPad-Pro--12-9-inch---3rd-generation-, 12.1
iPhone-4s, 9.3
iPad-2, 9.3

Note that ionic/cordova bakes in a version of ios-sim that might be older.

from ios-sim.

shazron avatar shazron commented on June 29, 2024

Added the iOS 11.4 simulator, I still can't repro the problem, output seems normal:

$ ios-sim showdevicetypes
Apple-TV-1080p, tvOS 12.1
Apple-TV-4K-4K, tvOS 12.1
Apple-TV-4K-1080p, tvOS 12.1
Apple-Watch-Series-2-38mm, watchOS 5.1
Apple-Watch-Series-2-42mm, watchOS 5.1
Apple-Watch-Series-3-38mm, watchOS 5.1
Apple-Watch-Series-3-42mm, watchOS 5.1
Apple-Watch-Series-4-40mm, watchOS 5.1
Apple-Watch-Series-4-44mm, watchOS 5.1
iPhone-5, 10.3
iPhone-5, 9.3
iPhone-5s, 10.3
iPhone-5s, 12.1
iPhone-5s, 9.3
iPhone-5s, 11.4
iPhone-6, 10.3
iPhone-6, 12.1
iPhone-6, 9.3
iPhone-6, 11.4
iPhone-6-Plus, 10.3
iPhone-6-Plus, 12.1
iPhone-6-Plus, 9.3
iPhone-6-Plus, 11.4
iPhone-6s, 10.3
iPhone-6s, 12.1
iPhone-6s, 9.3
iPhone-6s, 11.4
iPhone-6s-Plus, 10.3
iPhone-6s-Plus, 12.1
iPhone-6s-Plus, 9.3
iPhone-6s-Plus, 11.4
iPhone-7, 10.3
iPhone-7, 12.1
iPhone-7, 11.4
iPhone-7-Plus, 10.3
iPhone-7-Plus, 12.1
iPhone-7-Plus, 11.4
iPhone-SE, 10.3
iPhone-SE, 12.1
iPhone-SE, 11.4
iPad-Air, 10.3
iPad-Air, 12.1
iPad-Air, 9.3
iPad-Air, 11.4
iPad-Air-2, 10.3
iPad-Air-2, 12.1
iPad-Air-2, 9.3
iPad-Air-2, 11.4
iPad--5th-generation-, 10.3
iPad--5th-generation-, 12.1
iPad--5th-generation-, 11.4
iPad-Pro--9-7-inch-, 10.3
iPad-Pro, 10.3
iPad-Pro--12-9-inch---2nd-generation-, 10.3
iPad-Pro--12-9-inch---2nd-generation-, 12.1
iPad-Pro--12-9-inch---2nd-generation-, 11.4
iPad-Pro--10-5-inch-, 10.3
iPad-Pro--10-5-inch-, 12.1
iPad-Pro--10-5-inch-, 11.4
iPad-Retina, 9.3
iPhone-8, 12.1
iPhone-8, 11.4
iPhone-8-Plus, 12.1
iPhone-8-Plus, 11.4
iPhone-X, 12.1
iPhone-X, 11.4
iPad-Pro--9-7-inch-, 12.1
iPad-Pro--9-7-inch-, 9.3
iPad-Pro--9-7-inch-, 11.4
iPad-Pro, 12.1
iPad-Pro, 11.4
iPad--6th-generation-, 12.1
iPhone-XS, 12.1
iPhone-XS-Max, 12.1
iPhone-XR, 12.1
iPad-Pro--11-inch-, 12.1
iPad-Pro--12-9-inch---3rd-generation-, 12.1
iPhone-4s, 9.3
iPad-2, 9.3

from ios-sim.

replicadse avatar replicadse commented on June 29, 2024

I have the exact same behaviour as @ejerskov .
I also get all the devices using 'ios-sim showdevicetypes' but get not device using 'cordova run ios --list'.

from ios-sim.

shazron avatar shazron commented on June 29, 2024

This is fixed in [email protected]. cordova-ios has been updated to use the latest ios-sim but it needs a patch release that includes the fix, or you can install the nightly:
cordova platform add ios@nightly

from ios-sim.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.