Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support iPhone XS Max and 12.9-inch iPad Pro (3rd generation) #33

Open
zanuka opened this Issue Apr 9, 2019 · 16 comments

Comments

Projects
None yet
2 participants
@zanuka
Copy link

zanuka commented Apr 9, 2019

From the Apple Developer 'submitting iOS apps article',

Starting March 27, 2019, all app submissions for iPhone or iPad, including universal apps, will require screenshots for iPhone XS Max or the 12.9-inch iPad Pro (3rd generation).

We ended up taking manual screenshots in Xcode to submit our latest update, however it would be excellent to update/create configs so that screenshots can be leveraged in fastlane, travis or other pipeline configs.

@mmcc007 I've added notes about this to my previously closed PR #15, which I'm now working on again, but that PR should just focus on the frame color options and the new configs could be handled in separate PR's or whatever you see fit. Happy to help.

@mmcc007

This comment has been minimized.

Copy link
Owner

mmcc007 commented Apr 10, 2019

Good catch...

12.9-inch iPad Pro is already supported, so should be matching store requirements.
So just have to add

      - iPad Pro (12.9-inch) (2nd generation)
      - iPad Pro (12.9-inch) (3rd generation)

to screens.yaml. (AFAIK, the frame is the same).

Adding the iPhone XS Max should be relatively straight forward.

Since the screen size ratios are identical (to 2 decimal points)...

  • iPhone X
    1125x2436

  • iPhone XS
    1125/2436=0.461412151067323

  • iPhone XS Max
    1242/2688=0.462053571428571

... we might get lucky and only have to update the screens.yaml:

      - iPhone X
      - iPhone XS
      - iPhone XS Max

In this case, no code change should be necessary, but there may be some nuances in the way they are now handling images.

If the App Store does not auto-scale the iPhone X image to the iPhone XS Max image then we will have to do introduce a new screen size, 6.5 inches, and a scaled-up version of the status bar for iPhone XS Max.

Also, it seems that they now discourage using frames and are rounding-off the corners of the images. Are they also adding the iPhone X notch or do we have to (if not using frames)?

If you want to create a PR for this that would be great.

@mmcc007 mmcc007 added the enhancement label Apr 10, 2019

@mmcc007

This comment has been minimized.

Copy link
Owner

mmcc007 commented Apr 10, 2019

Regarding

  • make the generated png's transparent like the ones captured from Xcode Simulator

mentioned in
#15 (comment)

The images generated by the reference app can be found in
https://github.com/mmcc007/screenshots/releases
and should have transparent backgrounds for both iOS and android (when using frames)

@zanuka

This comment has been minimized.

Copy link
Author

zanuka commented Apr 10, 2019

All sounds good, thanks for the detailed response. I'll continue ahead and if I can get them all generating properly and looking good, will submit a new PR.

@mmcc007

This comment has been minimized.

Copy link
Owner

mmcc007 commented Apr 10, 2019

Great!

BTW: I added the lines above to screens.yaml and ran a build online.
It looks like it ran to completion:
https://travis-ci.com/mmcc007/screenshots/builds/107851257
I have not looked at the images generated by the iPhone XS Max (I need to upgrade to latest XCode on my local mac).
You might want to try something like this and see if the App Store will accept the images.

You can see the commit in dev:
efc0069

@zanuka

This comment has been minimized.

Copy link
Author

zanuka commented Apr 10, 2019

The problem with the transparent pngs (when using frames) is that they look bad on the AppStore (iOS) ... AFAIK png with transparency is not technically recommended so it would be nice to also provide a background option to imagemagik so you could still have the frame option but when it generates the final image it flattens it on top of a background image layer (not sure if that's possible).

I guess the alternative would be to just turn off frames for iOS, but still a background color would be a nice feature.

@mmcc007

This comment has been minimized.

Copy link
Owner

mmcc007 commented Apr 10, 2019

I'm guessing the 'bad look' is that AppStore is over-writing the transparency 'color' with black (if not, let me know what the 'bad look' is about).

Replacing transparency with a custom color, would involve adding a preferred color in screenshots.yaml (when using frames) and passing that color to imagemagick.

ImageMagick currently uses 'transparency' as the default background 'color':


But this can be replaced with a preferred color.

Is this something you plan to include in your PR?

@zanuka

This comment has been minimized.

Copy link
Author

zanuka commented Apr 10, 2019

Yeah that's exactly it

I think we're just going to use the screenshots without a frame since most other apps do it that way. Not sure why we had submitted that way in the first place. That said, thanks for pointing out the line where bg color is set, easy enough to experiment with now...

Cheers

@mmcc007

This comment has been minimized.

Copy link
Owner

mmcc007 commented Apr 10, 2019

Ah, IC whats going on now with the 'bad look'... thanks. (totally forgot that's not a new thing)

Frames in the Play Store works well:
https://play.google.com/store/apps/details?id=com.orbsoft.todo

... not so much in the App Store (since they disallow transparency)...

Maybe a good compromise is to default to transparency in Play Store and white in App Store...

What do you think?

@zanuka

This comment has been minimized.

Copy link
Author

zanuka commented Apr 11, 2019

Maybe a good compromise is to default to transparency in Play Store and white in App Store...

I think that would make the most sense 👍

@zanuka

This comment has been minimized.

Copy link
Author

zanuka commented Apr 11, 2019

So I've been trying to get XS and XS Max to work by just updating the screenshots.yaml, no luck yet... I also tried updating screens.yaml in my local project (forked repo) to the following:

  5.8inch:
    size: 1125x2436
    background: white
    resize: 87%
    resources:
      statusbar: resources/ios/1125/statusbar_white.png
      frame: resources/ios/phones/iPhone_X_Space_Grey.png
    offset: -0-0
    devices:
      # - iPhone X
      - iPhone XS
  6.5inch:
    size: 1242x2688
    resize: 75%
    resources:
      statusbar: resources/ios/1242/statusbar_black.png
      frame: resources/ios/phones/iPhone_XS_Max_Space_Grey.png
    offset: -0-0
    devices:
      - iPhone XS Max

however, when I uncomment line 112 of config.dart

I get the following output after running screenshots from project repo:

device=iPhone XS Max, simulator=Closure: (String, bool, [String, String, bool]) => void from Function 'simulator': static.
Unhandled exception:
Bad state: No element
#0      List.last (dart:core/runtime/libgrowable_array.dart:220:5)
#1      getHighestIosVersion (package:screenshots/utils.dart:164:42)
#2      Config.isSimulatorInstalled.<anonymous closure> (package:screenshots/config.dart:117:32)

any ideas?

@zanuka

This comment has been minimized.

Copy link
Author

zanuka commented Apr 11, 2019

I think I can see the issue now...

If I print out line 48 of config.dart I can see that the data for the XS and XS Max in simulators Map is empty:

iPhone XS: {}, iPhone XS Max: {},

I thought it would be resolved if I fired up those simulators in Xcode, since I hadn't opened them previously, but to no avail.

@mmcc007

This comment has been minimized.

Copy link
Owner

mmcc007 commented Apr 11, 2019

Per efc0069 I added some lines to screens.yaml and screenshots.yaml. After that just had to make sure the new simulators were installed using:

xcrun simctl list devices

This was tested in:
https://travis-ci.com/mmcc007/screenshots/builds/107851257

Something similar should work on your fork running on your machine.
I'm guessing that if the maps above are empty, then the simulators are not installed on your machine. (In that case, the config validator should have caught it, so there may be a bug somewhere.)

If the Max images don't scale-up in the App Store, then can add the 6.5 inch screen (as it looks like you are already doing).

If not resolved, might be worth sending the output from:

xcrun simctl list devices --json

and your 'flutter doctor -v'

@zanuka

This comment has been minimized.

Copy link
Author

zanuka commented Apr 12, 2019

It's odd, I can verify all the iOS simulators are indeed installed because I can debug with them locally, however if I run this:
xcrun simctl list devices

I get (unavailable, runtime profile not found) for each device:

-- Unavailable: com.apple.CoreSimulator.SimRuntime.iOS-12-1 --
    iPhone 5s (1FB2DAD0-9855-4D7A-BB1E-8C2246E52C40) (Shutdown) (unavailable, runtime profile not found)
    iPhone 6 (2F207019-3396-4354-B2F1-AA3A381DE964) (Shutdown) (unavailable, runtime profile not found)
    iPhone 6 Plus (0E744502-F606-4344-BD82-8448788809ED) (Shutdown) (unavailable, runtime profile not found)
    iPhone 6s (2D51D9AB-2136-4ADD-9D24-16A42A3565A8) (Shutdown) (unavailable, runtime profile not found)
    iPhone 6s Plus (AA7D75C3-4747-4C0F-BD04-FDB0B6BA79C3) (Shutdown) (unavailable, runtime profile not found)
    iPhone 7 (F75E4D8D-D596-4B92-BEBA-935DC840B4AB) (Shutdown) (unavailable, runtime profile not found)
    iPhone 7 Plus (B6BA0092-0A54-480F-87D2-ED8524D85365) (Shutdown) (unavailable, runtime profile not found)
    iPhone 8 (216E633E-FBC9-4F85-9EA6-AF936C303B51) (Shutdown) (unavailable, runtime profile not found)
    iPhone 8 Plus (74AD80E0-D319-40EE-960B-D67E87DDAA9D) (Shutdown) (unavailable, runtime profile not found)
    iPhone SE (B21DEF8D-2D81-4807-839B-6EA9697D95F2) (Shutdown) (unavailable, runtime profile not found)
    iPhone X (1DF65DB2-6632-4AB7-88FA-58A897A54DAF) (Shutdown) (unavailable, runtime profile not found)
    iPhone XS (B20278FA-1042-4497-BA71-79C35397B5BA) (Shutdown) (unavailable, runtime profile not found)
    iPhone XS Max (05486DAE-1FE5-47A4-8CDC-A9E13387AAE8) (Shutdown) (unavailable, runtime profile not found)
    iPhone XR (0FC107FF-D637-4935-ACC3-ABAC00B1E4BC) (Shutdown) (unavailable, runtime profile not found)
    iPad Air (4C62E4C3-C86F-45FB-A881-E94F72215830) (Shutdown) (unavailable, runtime profile not found)
    iPad Air 2 (3392B388-7FC5-4BAE-9C02-0FDBD18A08EE) (Shutdown) (unavailable, runtime profile not found)
    iPad (5th generation) (C7157E36-213C-4C2C-9F31-81622213E5C0) (Shutdown) (unavailable, runtime profile not found)
    iPad Pro (9.7-inch) (9E2E5759-7EA1-4B1F-BA5F-3D787B59950F) (Shutdown) (unavailable, runtime profile not found)
    iPad Pro (12.9-inch) (598A1767-AEE4-4BEE-A8AD-E0FCF1458A88) (Shutdown) (unavailable, runtime profile not found)
    iPad Pro (12.9-inch) (2nd generation) (7B0572DB-3891-4332-928D-3A8813B3BED6) (Shutdown) (unavailable, runtime profile not found)
    iPad Pro (10.5-inch) (5A5DF794-B947-4456-8A81-2775F3740EF2) (Shutdown) (unavailable, runtime profile not found)
    iPad (6th generation) (4CAE219D-5B6F-4305-B076-6B9BD56A7D3A) (Shutdown) (unavailable, runtime profile not found)
    iPad Pro (11-inch) (50D708E9-B294-4B32-BCBF-E923B94DE53B) (Shutdown) (unavailable, runtime profile not found)
    iPad Pro (12.9-inch) (3rd generation) (73944A4D-9C21-4527-9E65-7988635F8B0E) (Shutdown) (unavailable, runtime profile not found)
@mmcc007

This comment has been minimized.

Copy link
Owner

mmcc007 commented Apr 12, 2019

Would be curious how screenshots is parsing this situation. Can you send the output of:

xcrun simctl list devices --json

and I can run some tests on how it should be parsed (similar to https://github.com/mmcc007/screenshots/blob/master/test/regression_test.dart) ... seems like this json output is formatted differently across various installations of Xcode.
(your 'flutter doctor -v' might be helpful also) -- looks like should be filtering output better for 'unavailable' simulators to avoid the empty maps above.

Apparently simulator installation can be fixed by restarting some process:
https://stackoverflow.com/questions/53261256/xcode-10-simulator-runtime-is-not-available-runtime-profile-not-found-error
.. otherwise, may have to experiment with re-installing (and rebooting).
(Interested in how you fix this as I have possibly related problem with flutter finding simulators in one local macOS too!)

BTW: might want to try manually starting a simulator and see if flutter can find it using:

flutter devices

mmcc007 added a commit that referenced this issue Apr 13, 2019

Removed unavailable simulators completely to avoid case where
no alternative exists. Avoids error when later attempting to find highest
available simulator as reported in #33.
@zanuka

This comment has been minimized.

Copy link
Author

zanuka commented Apr 15, 2019

seems to be fine on the new iMac I have in my home office:

  "devices" : {
    "com.apple.CoreSimulator.SimRuntime.tvOS-12-2" : [
      {
        "availability" : "(available)",
        "state" : "Shutdown",
        "isAvailable" : true,
        "name" : "Apple TV",
        "udid" : "5DBE66D2-49C7-4883-8FE4-28A63524BCA8",
        "availabilityError" : ""
      },
      {
        "availability" : "(available)",
        "state" : "Shutdown",
        "isAvailable" : true,
        "name" : "Apple TV 4K",
        "udid" : "E0B16980-F416-45FD-8FE0-29D6D412F2C5",
        "availabilityError" : ""
      },
      {
        "availability" : "(available)",
        "state" : "Shutdown",
        "isAvailable" : true,
        "name" : "Apple TV 4K (at 1080p)",
        "udid" : "F112179D-3F30-4BA3-B014-929B10A87A0C",
        "availabilityError" : ""
      }
    ],
    "com.apple.CoreSimulator.SimRuntime.watchOS-5-2" : [
      {
        "availability" : "(available)",
        "state" : "Shutdown",
        "isAvailable" : true,
        "name" : "Apple Watch Series 2 - 38mm",
        "udid" : "5972F4A6-B41B-4401-B275-3E4F2ACF8A50",
        "availabilityError" : ""
      },
      {
        "availability" : "(available)",
        "state" : "Shutdown",
        "isAvailable" : true,
        "name" : "Apple Watch Series 2 - 42mm",
        "udid" : "4022EC4B-D183-4B69-89D6-771185D8A9ED",
        "availabilityError" : ""
      },
      {
        "availability" : "(available)",
        "state" : "Shutdown",
        "isAvailable" : true,
        "name" : "Apple Watch Series 3 - 38mm",
        "udid" : "ED63B942-4CC8-4C93-B7B6-4E7D0B81501D",
        "availabilityError" : ""
      },
      {
        "availability" : "(available)",
        "state" : "Shutdown",
        "isAvailable" : true,
        "name" : "Apple Watch Series 3 - 42mm",
        "udid" : "7B0FAD93-C824-4D7B-B64B-49CF4574D64A",
        "availabilityError" : ""
      },
      {
        "availability" : "(available)",
        "state" : "Shutdown",
        "isAvailable" : true,
        "name" : "Apple Watch Series 4 - 40mm",
        "udid" : "193B28C0-3EE6-4EE4-B109-64D149AB872A",
        "availabilityError" : ""
      },
      {
        "availability" : "(available)",
        "state" : "Shutdown",
        "isAvailable" : true,
        "name" : "Apple Watch Series 4 - 44mm",
        "udid" : "53F464EF-A69E-4587-8CD1-45EDA55D8800",
        "availabilityError" : ""
      }
    ],
    "com.apple.CoreSimulator.SimRuntime.iOS-12-2" : [
      {
        "availability" : "(available)",
        "state" : "Shutdown",
        "isAvailable" : true,
        "name" : "iPhone 5s",
        "udid" : "C315E51F-FA02-4FD9-A279-42F0785C67D3",
        "availabilityError" : ""
      },
      {
        "availability" : "(available)",
        "state" : "Shutdown",
        "isAvailable" : true,
        "name" : "iPhone 6",
        "udid" : "90EC9B42-3308-4B32-9BCD-1352246D2FAA",
        "availabilityError" : ""
      },
      {
        "availability" : "(available)",
        "state" : "Shutdown",
        "isAvailable" : true,
        "name" : "iPhone 6 Plus",
        "udid" : "5D6B95F7-B637-4C34-9CF5-C143054DE07C",
        "availabilityError" : ""
      },
      {
        "availability" : "(available)",
        "state" : "Shutdown",
        "isAvailable" : true,
        "name" : "iPhone 6s",
        "udid" : "A29F5534-38A6-4B6C-B776-8E7EDD951DE3",
        "availabilityError" : ""
      },
      {
        "availability" : "(available)",
        "state" : "Shutdown",
        "isAvailable" : true,
        "name" : "iPhone 6s Plus",
        "udid" : "776F8FE9-2850-4293-9BB4-58BAFF5B7AA6",
        "availabilityError" : ""
      },
      {
        "availability" : "(available)",
        "state" : "Shutdown",
        "isAvailable" : true,
        "name" : "iPhone 7",
        "udid" : "5002C59F-E848-4275-80AF-105809361F42",
        "availabilityError" : ""
      },
      {
        "availability" : "(available)",
        "state" : "Shutdown",
        "isAvailable" : true,
        "name" : "iPhone 7 Plus",
        "udid" : "5B17EB49-4826-4B2E-AA8E-CA66F584B327",
        "availabilityError" : ""
      },
      {
        "availability" : "(available)",
        "state" : "Shutdown",
        "isAvailable" : true,
        "name" : "iPhone 8",
        "udid" : "CBB04B54-68AC-4E4B-AB35-B22E1BAF83E1",
        "availabilityError" : ""
      },
      {
        "availability" : "(available)",
        "state" : "Shutdown",
        "isAvailable" : true,
        "name" : "iPhone 8 Plus",
        "udid" : "FFD4D7E1-1E76-4633-936F-AAC837B6F04D",
        "availabilityError" : ""
      },
      {
        "availability" : "(available)",
        "state" : "Shutdown",
        "isAvailable" : true,
        "name" : "iPhone SE",
        "udid" : "13F57D4A-49B6-450C-B644-05164E8B64EA",
        "availabilityError" : ""
      },
      {
        "availability" : "(available)",
        "state" : "Shutdown",
        "isAvailable" : true,
        "name" : "iPhone X",
        "udid" : "77D48DEC-FD5F-4500-B13A-D589B2FB80A4",
        "availabilityError" : ""
      },
      {
        "availability" : "(available)",
        "state" : "Shutdown",
        "isAvailable" : true,
        "name" : "iPhone Xs",
        "udid" : "CC176FE0-9271-450F-8279-ED30FDDF644A",
        "availabilityError" : ""
      },
      {
        "availability" : "(available)",
        "state" : "Shutdown",
        "isAvailable" : true,
        "name" : "iPhone Xs Max",
        "udid" : "756ECF3E-1997-463A-8299-5706C58F5E0B",
        "availabilityError" : ""
      },
      {
        "availability" : "(available)",
        "state" : "Shutdown",
        "isAvailable" : true,
        "name" : "iPhone Xʀ",
        "udid" : "6E24A8CB-FBF9-4C63-99EE-177DE8EBCB48",
        "availabilityError" : ""
      },
      {
        "availability" : "(available)",
        "state" : "Shutdown",
        "isAvailable" : true,
        "name" : "iPad Air (3rd generation)",
        "udid" : "98AE22ED-B81A-4BAE-9B59-7E7D31FBE554",
        "availabilityError" : ""
      },
      {
        "availability" : "(available)",
        "state" : "Shutdown",
        "isAvailable" : true,
        "name" : "iPad Air",
        "udid" : "062AFF56-016F-4AAC-A0C4-8458B451D16F",
        "availabilityError" : ""
      },
      {
        "availability" : "(available)",
        "state" : "Shutdown",
        "isAvailable" : true,
        "name" : "iPad Air 2",
        "udid" : "17B569C7-85FD-469D-B34F-7ECBCB6A4F85",
        "availabilityError" : ""
      },
      {
        "availability" : "(available)",
        "state" : "Shutdown",
        "isAvailable" : true,
        "name" : "iPad (5th generation)",
        "udid" : "EE395DB3-860A-46E5-B679-A8A3887E5683",
        "availabilityError" : ""
      },
      {
        "availability" : "(available)",
        "state" : "Shutdown",
        "isAvailable" : true,
        "name" : "iPad Pro (9.7-inch)",
        "udid" : "7D4C52FF-1F2F-41C3-812E-F833548F41C6",
        "availabilityError" : ""
      },
      {
        "availability" : "(available)",
        "state" : "Shutdown",
        "isAvailable" : true,
        "name" : "iPad Pro (12.9-inch)",
        "udid" : "227F40BC-2342-4FAF-9650-8C140DC212DF",
        "availabilityError" : ""
      },
      {
        "availability" : "(available)",
        "state" : "Shutdown",
        "isAvailable" : true,
        "name" : "iPad Pro (12.9-inch) (2nd generation)",
        "udid" : "7F7E5992-1ADF-488D-B8A5-C7F1CB3E7EB9",
        "availabilityError" : ""
      },
      {
        "availability" : "(available)",
        "state" : "Shutdown",
        "isAvailable" : true,
        "name" : "iPad Pro (10.5-inch)",
        "udid" : "6D464A4E-4BE7-45A4-9E46-65188B354C34",
        "availabilityError" : ""
      },
      {
        "availability" : "(available)",
        "state" : "Shutdown",
        "isAvailable" : true,
        "name" : "iPad (6th generation)",
        "udid" : "88E51828-7045-49FD-BCC1-14673AE3C225",
        "availabilityError" : ""
      },
      {
        "availability" : "(available)",
        "state" : "Shutdown",
        "isAvailable" : true,
        "name" : "iPad Pro (11-inch)",
        "udid" : "C4FA685E-712D-42E5-B9B3-C88BE35ADCB6",
        "availabilityError" : ""
      },
      {
        "availability" : "(available)",
        "state" : "Shutdown",
        "isAvailable" : true,
        "name" : "iPad Pro (12.9-inch) (3rd generation)",
        "udid" : "2A6C6859-2854-4548-A12A-17BECABFCCC3",
        "availabilityError" : ""
      }
    ]
  }
}```
@mmcc007

This comment has been minimized.

Copy link
Owner

mmcc007 commented Apr 18, 2019

0455b22 should hopefully resolve this interim environment problem... will add to next release.
(also.. was able to fix problem mentioned on my mac... so that's a good thing)

With efc0069 we should be close to resolving this issue. Just need to add support for 'white for ios' and 'transparent for android' as the new default. Since you seem to be doing releases at the moment (so can test this) and you have an active fork, is that something you want to pursue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.