Skip to content

ios-sim does not work for iPad-Pro for iOS 10 runtime #197

Closed
@aharbick

Description

@aharbick

Command and results (I've got iOS 10 and 9.3 simulators installed and I can launch the iPad-Pro 9.7 and 12.9 devices in the simulator but this is the result of my command.

bash-3.2$ ios-sim showdevicetypes
iPhone-4s, 9.3
iPhone-5, 9.3
iPhone-5, 10.0
iPhone-5s, 9.3
iPhone-5s, 10.0
iPhone-6, 9.3
iPhone-6, 10.0
iPhone-6-Plus, 9.3
iPhone-6-Plus, 10.0
iPhone-6s, 9.3
iPhone-6s, 10.0
iPhone-6s-Plus, 9.3
iPhone-6s-Plus, 10.0
iPad-2, 9.3
iPad-Retina, 9.3
iPad-Retina, 10.0
iPad-Air, 9.3
iPad-Air, 10.0
iPad-Air-2, 9.3
iPad-Air-2, 10.0
iPhone-7, 10.0
iPhone-7-Plus, 10.0
iPhone-SE, 10.0
Apple-TV-1080p, tvOS 10.0
Apple-Watch-38mm, watchOS 3.0
Apple-Watch-42mm, watchOS 3.0
Apple-Watch-Series-2-38mm, watchOS 3.0
Apple-Watch-Series-2-42mm, watchOS 3.0

Further if I try to install an app into the simulator like so

phonegap run ios --target "iPad-Pro" --emulator

I get this error

No available runtimes could be found for "iPad Pro (12.9-inch)".

Below is the requested version information.

sw_vers

ProductName:    Mac OS X
ProductVersion: 10.11.6
BuildVersion:   15G1004

ios-sim --version

5.0.8

xcodebuild -version

Xcode 8.0
Build version 8A218a

xcode-select --print-path

/Applications/Xcode.app/Contents/Developer

gcc --version

Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 8.0.0 (clang-800.0.38)
Target: x86_64-apple-darwin15.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

Activity

aharbick

aharbick commented on Oct 8, 2016

@aharbick
Author

I'm pretty sure this is because

xcrun simctl list devices

Is not reporting iPad Pro as this

    iPad Pro (9.7 inch) (94B87E6E-51EA-41BA-BDAD-DDA3246712E3) (Shutdown)
    iPad Pro (12.9 inch) (C0F6C6F5-80EA-497C-86AD-02A5176E1D30) (Shutdown)

And the regexps in simctl/lib/simctl-list-parser.js are not expecting the "(12.9 inch)" in the names for the devices.

aharbick

aharbick commented on Oct 8, 2016

@aharbick
Author

Another problem is that

xcrun simctl list devicetypes

Uses a format for the name of the device

iPad Pro (12.9-inch) (com.apple.CoreSimulator.SimDeviceType.iPad-Pro)

I monkeyed around with simctl-list-parser.js over in the simctl wrapper. Doing that I got ios-sim showdevicetypes to work.

Here's the commit in my fork: aharbick/simctl@37028f9

I'd submit a PR, but I don't have a good enough sense of the process or the potential impacts elsewhere in the ecosystem.

Let me know how else I can help.

changed the title [-]ios-sim does not show iPad-Pro devices any longer[/-] [+]ios-sim does not work for iPad-Pro for iOS 10 runtime[/+] on Oct 8, 2016
shazron

shazron commented on Oct 18, 2016

@shazron

Thanks! evaluating this now in simctl.

shazron

shazron commented on Oct 20, 2016

@shazron

Fixed in ios-control/simctl#11 after adding failing tests.
I will push a new simctl version and use it in a new ios-sim release

pvadam

pvadam commented on Oct 28, 2016

@pvadam

It still does not show iPad Pro!

$ ios-sim --version
5.0.9
$ xcrun simctl list devicetypes
== Device Types ==
iPhone 4s (com.apple.CoreSimulator.SimDeviceType.iPhone-4s)
iPhone 5 (com.apple.CoreSimulator.SimDeviceType.iPhone-5)
iPhone 5s (com.apple.CoreSimulator.SimDeviceType.iPhone-5s)
iPhone 6 (com.apple.CoreSimulator.SimDeviceType.iPhone-6)
iPhone 6 Plus (com.apple.CoreSimulator.SimDeviceType.iPhone-6-Plus)
iPhone 6s (com.apple.CoreSimulator.SimDeviceType.iPhone-6s)
iPhone 6s Plus (com.apple.CoreSimulator.SimDeviceType.iPhone-6s-Plus)
iPhone 7 (com.apple.CoreSimulator.SimDeviceType.iPhone-7)
iPhone 7 Plus (com.apple.CoreSimulator.SimDeviceType.iPhone-7-Plus)
iPhone SE (com.apple.CoreSimulator.SimDeviceType.iPhone-SE)
iPad 2 (com.apple.CoreSimulator.SimDeviceType.iPad-2)
iPad Retina (com.apple.CoreSimulator.SimDeviceType.iPad-Retina)
iPad Air (com.apple.CoreSimulator.SimDeviceType.iPad-Air)
iPad Air 2 (com.apple.CoreSimulator.SimDeviceType.iPad-Air-2)
iPad Pro (9.7-inch) (com.apple.CoreSimulator.SimDeviceType.iPad-Pro--9-7-inch-)
iPad Pro (12.9-inch) (com.apple.CoreSimulator.SimDeviceType.iPad-Pro)
Apple TV 1080p (com.apple.CoreSimulator.SimDeviceType.Apple-TV-1080p)
Apple Watch - 38mm (com.apple.CoreSimulator.SimDeviceType.Apple-Watch-38mm)
Apple Watch - 42mm (com.apple.CoreSimulator.SimDeviceType.Apple-Watch-42mm)
Apple Watch Series 2 - 38mm (com.apple.CoreSimulator.SimDeviceType.Apple-Watch-Series-2-38mm)
Apple Watch Series 2 - 42mm (com.apple.CoreSimulator.SimDeviceType.Apple-Watch-Series-2-42mm)
$ ios-sim showdevicetypes
iPhone-5, 10.0
iPhone-5s, 10.0
iPhone-6, 10.0
iPhone-6-Plus, 10.0
iPhone-6s, 10.0
iPhone-6s-Plus, 10.0
iPhone-7, 10.0
iPhone-7-Plus, 10.0
iPhone-SE, 10.0
iPad-Retina, 10.0
iPad-Air, 10.0
iPad-Air-2, 10.0
Apple-TV-1080p, tvOS 10.0
Apple-Watch-38mm, watchOS 3.0
Apple-Watch-42mm, watchOS 3.0
Apple-Watch-Series-2-38mm, watchOS 3.0
Apple-Watch-Series-2-42mm, watchOS 3.0

Did I miss something? The fork aharbick/simctl@37028f9 lists the two iPad Pros also:

$ ios-sim showdevicetypes
iPhone-5, 10.0
iPhone-5s, 10.0
iPhone-6, 10.0
iPhone-6-Plus, 10.0
iPhone-6s, 10.0
iPhone-6s-Plus, 10.0
iPhone-7, 10.0
iPhone-7-Plus, 10.0
iPhone-SE, 10.0
iPad-Retina, 10.0
iPad-Air, 10.0
iPad-Air-2, 10.0
iPad-Pro--9-7-inch-, 10.0
iPad-Pro, 10.0
Apple-TV-1080p, tvOS 10.0
Apple-Watch-38mm, watchOS 3.0
Apple-Watch-42mm, watchOS 3.0
Apple-Watch-Series-2-38mm, watchOS 3.0
Apple-Watch-Series-2-42mm, watchOS 3.0
shazron

shazron commented on Oct 28, 2016

@shazron

Looks like Apple is not being consistent in their device type names for the iPad Pros:

== Device Types ==
iPhone 4s (com.apple.CoreSimulator.SimDeviceType.iPhone-4s)
iPhone 5 (com.apple.CoreSimulator.SimDeviceType.iPhone-5)
iPhone 5s (com.apple.CoreSimulator.SimDeviceType.iPhone-5s)
iPhone 6 (com.apple.CoreSimulator.SimDeviceType.iPhone-6)
iPhone 6 Plus (com.apple.CoreSimulator.SimDeviceType.iPhone-6-Plus)
iPhone 6s (com.apple.CoreSimulator.SimDeviceType.iPhone-6s)
iPhone 6s Plus (com.apple.CoreSimulator.SimDeviceType.iPhone-6s-Plus)
iPhone 7 (com.apple.CoreSimulator.SimDeviceType.iPhone-7)
iPhone 7 Plus (com.apple.CoreSimulator.SimDeviceType.iPhone-7-Plus)
iPhone SE (com.apple.CoreSimulator.SimDeviceType.iPhone-SE)
iPad 2 (com.apple.CoreSimulator.SimDeviceType.iPad-2)
iPad Retina (com.apple.CoreSimulator.SimDeviceType.iPad-Retina)
iPad Air (com.apple.CoreSimulator.SimDeviceType.iPad-Air)
iPad Air 2 (com.apple.CoreSimulator.SimDeviceType.iPad-Air-2)
iPad Pro (9.7-inch) (com.apple.CoreSimulator.SimDeviceType.iPad-Pro--9-7-inch-)
iPad Pro (12.9-inch) (com.apple.CoreSimulator.SimDeviceType.iPad-Pro)
Apple TV 1080p (com.apple.CoreSimulator.SimDeviceType.Apple-TV-1080p)
Apple Watch - 38mm (com.apple.CoreSimulator.SimDeviceType.Apple-Watch-38mm)
Apple Watch - 42mm (com.apple.CoreSimulator.SimDeviceType.Apple-Watch-42mm)
Apple Watch Series 2 - 38mm (com.apple.CoreSimulator.SimDeviceType.Apple-Watch-Series-2-38mm)
Apple Watch Series 2 - 42mm (com.apple.CoreSimulator.SimDeviceType.Apple-Watch-Series-2-42mm)
== Devices ==
-- iOS 8.2 --
    Resizable iPad (D7465DA6-D5F7-49C2-9DED-29C22AF40E09) (Shutdown) (unavailable, device type profile not found)
    Resizable iPhone (FD05A655-E0D1-4D8A-9D3B-04F84D494F21) (Shutdown) (unavailable, device type profile not found)
-- iOS 8.4 --
    Resizable iPad (163B7304-376C-4AF4-A0B6-88A5A8DE660D) (Shutdown) (unavailable, device type profile not found)
    Resizable iPhone (89B34D5F-C365-44A3-8D75-1369EB36EF49) (Shutdown) (unavailable, device type profile not found)
-- iOS 10.1 --
    iPad Pro (9.7 inch) (C7EC634B-5F7A-41E0-800E-8CE62B367F12) (Shutdown)
    iPad Pro (12.9 inch) (1835A74E-E4F6-4BAD-8000-C8712B642730) (Shutdown)

Note the hyphen in iPad Pro (9.7-inch) in Device Types and the one in Devices. ios-sim filters only those devicetypes that are in the runtimes as well since we need to get the device id.

aharbick

aharbick commented on Oct 28, 2016

@aharbick
Author

Right. Which is (unfortunately) why I had to do this in my commit:

image

shazron

shazron commented on Oct 28, 2016

@shazron

The fix here would be for ios-sim to hack this by (pseudocode):

if (device.name.startsWith('iPad Pro')) {
   // replace hyphens with spaces in the name
}
shazron

shazron commented on Oct 28, 2016

@shazron

@aharbick great! my patch is essentially the same, although I'm limiting the reach of this hack by the conditional

shazron

shazron commented on Oct 28, 2016

@shazron

I'll get a 5.10 patch out asap

shazron

shazron commented on Oct 28, 2016

@shazron

Hacking this in ios-sim only, since technicallysimctl is correct in reporting the output

shazron

shazron commented on Oct 28, 2016

@shazron
pvadam

pvadam commented on Oct 28, 2016

@pvadam

Wow! That was fast! And it works, thank you!!

sagrawal31

sagrawal31 commented on Nov 8, 2016

@sagrawal31

I updated this release but I still can't see iPad Pro in cordova emulate ios --list but ios-sim showdevicetypes shows the device:

iPhone-5, 10.1
iPhone-5s, 10.1
iPhone-6, 10.1
iPhone-6-Plus, 10.1
iPhone-6s, 10.1
iPhone-6s-Plus, 10.1
iPhone-7, 10.1
iPhone-7-Plus, 10.1
iPhone-SE, 10.1
iPad-Retina, 10.1
iPad-Air, 10.1
iPad-Air-2, 10.1
iPad-Pro--9-7-inch-, 10.1
iPad-Pro, 10.1
Apple-TV-1080p, tvOS 10.0
Apple-Watch-38mm, watchOS 3.1
Apple-Watch-42mm, watchOS 3.1
Apple-Watch-Series-2-38mm, watchOS 3.1
Apple-Watch-Series-2-42mm, watchOS 3.1

Am I missing something?

shazron

shazron commented on Nov 8, 2016

@shazron

For cordova issues, try filing an issue at http://issues.cordova.io instead

shazron

shazron commented on Nov 9, 2016

@shazron

@sagrawal14 filing a new issue for this, found the problem: #202

sagrawal31

sagrawal31 commented on Nov 10, 2016

@sagrawal31

Thanks @shazron. I saw the commit, great!

added this to the 5.0.10 milestone on Jun 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @shazron@aharbick@sagrawal31@pvadam

        Issue actions

          ios-sim does not work for iPad-Pro for iOS 10 runtime · Issue #197 · ios-control/ios-sim