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

frameit doesn't support iPhone 14 Pro screen size #20703

Closed
futuretap opened this issue Sep 26, 2022 · 39 comments · Fixed by fastlane/frameit-frames#31
Closed

frameit doesn't support iPhone 14 Pro screen size #20703

futuretap opened this issue Sep 26, 2022 · 39 comments · Fixed by fastlane/frameit-frames#31

Comments

@futuretap
Copy link
Contributor

futuretap commented Sep 26, 2022

New Issue Checklist

Issue Description

An error is shown: Unsupported screen size [1290, 2796] for path

Command executed

fastlane frameit

env

✅ fastlane environment ✅

Stack

Key Value
OS 12.6
Ruby 3.0.2
Bundler? false
Git git version 2.37.0 (Apple Git-136)
Installation Source ~/.rbenv/versions/3.0.2/bin/fastlane
Host macOS 12.6 (21G115)
Ruby Lib Dir ~/.rbenv/versions/3.0.2/lib
OpenSSL Version OpenSSL 1.1.1l 24 Aug 2021
Is contained false
Is homebrew false
Is installed via Fabric.app false
Xcode Path /Applications/Xcode-14.0.1-Release.Candidate.app/Contents/Developer/
Xcode Version 14.0.1
Swift Version 5.7

System Locale

Variable Value
LANG de_DE.UTF-8
LC_ALL
LANGUAGE

fastlane files:

No Fastfile found

No Appfile found

fastlane gems

Gem Version Update-Status
fastlane 2.210.1 ✅ Up-To-Date

Loaded fastlane plugins:

No plugins Loaded

Loaded gems
Gem Version
did_you_mean 1.5.0
atomos 0.1.3
rexml 3.2.5
CFPropertyList 3.0.5
claide 1.1.0
colored2 3.1.2
nanaimo 0.3.0
xcodeproj 1.21.0
rouge 2.0.7
xcpretty 0.3.0
terminal-notifier 2.0.0
unicode-display_width 1.8.0
terminal-table 1.8.0
plist 3.6.0
public_suffix 4.0.7
addressable 2.8.0
multipart-post 2.0.0
word_wrap 1.0.0
optparse 0.1.1
tty-screen 0.8.1
tty-cursor 0.7.1
tty-spinner 0.9.3
artifactory 3.0.15
babosa 1.0.4
colored 1.2
highline 2.0.3
commander 4.6.0
excon 0.91.0
faraday-em_http 1.0.0
faraday-em_synchrony 1.0.0
faraday-excon 1.1.0
faraday-httpclient 1.0.1
faraday-multipart 1.0.3
faraday-net_http 1.0.1
faraday-net_http_persistent 1.2.0
faraday-patron 1.0.0
faraday-rack 1.0.0
faraday-retry 1.0.3
ruby2_keywords 0.0.5
faraday 1.9.3
unf_ext 0.0.8
unf 0.1.4
domain_name 0.5.20190701
http-cookie 1.0.4
faraday-cookie_jar 0.0.7
faraday_middleware 1.2.0
fastimage 2.2.6
gh_inspector 1.1.3
json 2.5.1
mini_magick 4.11.0
naturally 2.2.1
rubyzip 2.3.2
security 0.1.3
xcpretty-travis-formatter 1.0.1
dotenv 2.7.6
bundler 2.2.22
simctl 1.6.8
jwt 2.5.0
uber 0.1.0
declarative 0.0.20
trailblazer-option 0.1.2
representable 3.1.1
retriable 3.1.2
mini_mime 1.1.2
memoist 0.16.2
multi_json 1.15.0
os 1.1.4
signet 0.16.0
googleauth 1.1.0
httpclient 2.8.3
webrick 1.7.0
google-apis-core 0.4.2
google-apis-playcustomapp_v1 0.7.0
google-apis-androidpublisher_v3 0.16.0
google-cloud-env 1.5.0
google-cloud-errors 1.2.0
google-cloud-core 1.6.0
google-apis-iamcredentials_v1 0.10.0
google-apis-storage_v1 0.11.0
rake 13.0.3
digest-crc 0.6.4
google-cloud-storage 1.36.0
emoji_regex 3.2.3
jmespath 1.5.0
aws-partitions 1.553.0
aws-eventstream 1.2.0
aws-sigv4 1.4.0
aws-sdk-core 3.126.0
aws-sdk-kms 1.54.0
aws-sdk-s3 1.112.0
tsort 0.1.0
uri 0.10.1
set 1.0.1
forwardable 1.3.2
logger 1.4.3
pathname 0.1.0
shellwords 0.1.0
cgi 0.2.0
date 3.1.0
timeout 0.1.1
stringio 3.0.0
securerandom 0.1.0
openssl 2.2.0
io-nonblock 0.1.0
ipaddr 1.2.2
io-wait 0.1.0
zlib 1.1.0
resolv 0.2.0
digest 3.0.0
time 0.1.0
open-uri 0.1.0
mutex_m 0.1.1
net-protocol 0.1.0
ostruct 0.3.1
english 0.7.1
erb 2.2.0
strscan 3.0.0
abbrev 0.1.0
io-console 0.5.7
tempfile 0.1.1
delegate 0.2.0
fileutils 1.5.0
tmpdir 0.1.2
base64 0.1.0
singleton 0.1.1
net-http 0.1.1
open3 0.1.1
nkf 0.1.0
prettyprint 0.1.0
pp 0.1.0
find 0.1.0
yaml 0.1.1
psych 3.3.0

generated on: 2022-09-26

@fastlane-bot
Copy link

It seems like you have not included the output of fastlane env
To make it easier for us help you resolve this issue, please update the issue to include the output of fastlane env 👍

@kmentrobin
Copy link

kmentrobin commented Oct 7, 2022

Hi I have own fork where I made it all work if you want I can create PR but it doesn't use Facebook Device because it is not yet supported but my own. I have support for iPhone 14 Pro and iPhone 14 Pro Max with device frames in Deep purple, Golf, black and silver. But my designs of iPhone 14 Pro and iPhone 14 Pro are slightly modified because the screen doesn't fit there :D Thanks apple.

So I well make the sides bigger to fit the screenshot in next iteration I will play around with adding corner radius to the screen shot to all rounded devices.
Snímek obrazovky 2022-10-07 v 8 45 22

But it looks good I think
iPhone 14 Pro Max-04_Checklist_AP_framed

@futuretap
Copy link
Contributor Author

Yeah, I noticed the big corner radius that lets the rectangular screen overlap the device bezel. I'd love to test your solution once you've figured out the masking.

@kmentrobin
Copy link

kmentrobin commented Oct 7, 2022

Yeah right now I went with the bigger bezel :D Making the corner radius would be bit harder for me and I have some more stuff to do now :D So it will be maybe next week or so :) So if you need it and you are okay with bigger bezels let me know and I will make the Prs and updates :)

@robinjanke
Copy link

Hey @kmentrobin i just saw your Fork and would also be happy if you can create a PR. Are you using the iPhone 13 Pro Max Device for the iPhone 14 Pro Max Frame in your current fork if i get this right?

@kmentrobin
Copy link

kmentrobin commented Oct 7, 2022

HI @robinjanke what a lovely name you got :D .
Here is the code to support the device
kmentrobin@fd93c11
But it also need to update frames here
https://github.com/fastlane/frameit-frames

Im using iPhone 14 Pro Max frame which I found somewhere on Figma and have to make the bezels thicker a bit to fit the screen. But it is own frame you can take a look on it here
Apple iPhone 14 Pro Max Deep Purple

@robinjanke
Copy link

@kmentrobin Thanks you very much for your fast response, i like your name too! :D

Right now i just updated fastlane with this line in my gemfile to your version:
gem 'fastlane', :git => 'https://github.com/kmentrobin/fastlane.git', :ref => '950bb820237d52e15690408083e328f739ac0ef3'
But i just got stuck with the same error message as before. Would it be enough to just download the frame that you sent and put it into the right folder or do i need to do something else like editing the offsets.json file?

@kmentrobin
Copy link

kmentrobin commented Oct 7, 2022

@robinjanke Yeah it is quite tricky right :D Well for now you have to put the frame to /Users/username/.fastlane/frameit/letest
And add following to the offsets.json to the end. And you should be golden :D

"iPhone 14 Pro Max": { "offset": "+81+68", "width": 1290 }, "iPhone 14 Pro Max Deep Purple": { "offset": "+81+68", "width": 1290 }

@fastlane-bot
Copy link

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.

Please make sure to update to the latest fastlane version and check if that solves the issue. Let us know if that works for you by adding a comment 👍

Friendly reminder: contributions are always welcome! Check out CONTRIBUTING.md for more information on how to help with fastlane and feel free to tackle this issue yourself 💪

This issue will be auto-closed if there is no reply within 1 month.

@yonicsurny
Copy link

Still no iPhone 14 Pro or iPhone 14 Pro Max on the Meta website. Is there any other source to use?

@robinjanke
Copy link

@yonicsurny I got this fixed by using my own offets.json and by downloading these files into the correct directory like @kmentrobin mentioned and it seems to work well. For the iPhone 14 Screenshots i just use an online image resize tool because the dimension of these devices is (nearly) the same

@robinjanke
Copy link

I just created a pr here with the files from @kmentrobin
fastlane/frameit-frames#30

You can use my fork or wait for the pr to get approved

@BPHvZ
Copy link

BPHvZ commented Nov 17, 2022

Apple also provides bezels in their design resources.
Download: iPhone 14 device bezels.

@kmentrobin maybe you could add the other device colours to your PR?

@kmentrobin
Copy link

Actually @robinjanke is making the PR. But I think it make much more sense to use Apple frames as source of truth for upcoming frames 🤔 The main issue there is borders of the iPhone 14 and fitting there rectangle 😅 still try to find time to change fastlane to add corner radius to images, but probably during Christmas 🎄 as small present for me 😂

@mindthefrog
Copy link

Thanks @kmentrobin @guidev @robinjanke.

Have people had a discussion/agreement on a good way to round the screenshot corners on the new thinner rounded bezel iPhones? Not a fastlane or IM expert but first thought would be to add an optional "rounded corner" attribute in the offsets file for these devices and convert screenshots prior to dropping them into the device frame using one of the methods detailed there: http://www.imagemagick.org/Usage/thumbnails/#rounded

Thoughts?

@futuretap
Copy link
Contributor Author

Sounds good to me!

@guidev
Copy link
Contributor

guidev commented Mar 4, 2023

@mindthefrog I've solved it in #20917 using the frame as a mask, that way the screenshot will be clipped automatically and not "bleed" outside of the frame.

@image = frame.composite(image, "png", frame) do |c|

@mindthefrog
Copy link

@mindthefrog I've solved it in #20917 using the frame as a mask, that way the screenshot will be clipped automatically and not "bleed" outside of the frame.

@image = frame.composite(image, "png", frame) do |c|

Thanks @guidev. I had seen and tried your change before posting. I am probably doing something wrong but that change does not work for me. Not only are the corners still visible beyond the frame, the screen itself is another copy of the frame with a black screen. This is on the most recent macOS.

Can masking the screenshot with the frame really work? The frames seem to be transparent both inside and outside the bezel. I am probably missing something but it's not working for me?

My solution for now is to run a script that rounds the iPhone 14 screenshot corners before I run frameit.

@ConfusedVorlon
Copy link
Contributor

iPhone 14 pro Max is now available on the Meta site

https://design.facebook.com/toolsandresources/devices/

@ConfusedVorlon
Copy link
Contributor

ConfusedVorlon commented Mar 9, 2023

for anyone hacking at this - I did the following

  1. downloaded new frames from this pull request (I just replaced the latest folder on my HD)
    https://github.com/fastlane/frameit-frames/pull/31

  2. added the following line to device_types.rb in the fastlane gem
    IPHONE_14_PRO_MAX ||= Frameit::Device.new("iphone14-pro-max", "Apple iPhone 14 Pro Max", 11, [[1290, 2796], [2796, 1290]], 458, Color::BLACK, Platform::IOS)

there is a very slight box artefact around the corners of the frame.
Probably because I haven't done this quite correctly. I'm ok to live with that for now...

@Danbana
Copy link

Danbana commented Mar 18, 2023

It's so frustrating that this always happens for the latest device. Fixing frameit is a part of the workflow. Anyhow it still saves time. Perhaps I should be more frustrated with Apple changing the size and adding more required devices.

A great item to add to the docs for frameit/snapshot would be the latest simulators to snap on for the latest device screenshots requirements.

Now Apple is requiring the
iPhone 14 Pro Max (for 6.7" Display requirement),
iPhone 8 Plus (for 5.5", not a default simulator),
iPad Pro (6th generation), and
iPad Pro (2nd Generation, not a default simulator).

Which I guess means I'll just not be updating the screenshots for the devices which don't have default simulators anymore.

Anyhow I have 25 languages supported in my app, The Photo Investigator and I appreciate this project. I guess it's time to nut up, fix it, and submit a PR for everyone else; although the availability of the frames seems to be a main sticking point every year for the latest device.

@Danbana
Copy link

Danbana commented Mar 18, 2023

OK I got it working using a combo of the other's directions above:

1 downloaded new frames from this pull request (my frames are in ~/.frameit/devices_frames_2/latest)
fastlane/frameit-frames#31

2 in that same folder ~/.frameit/devices_frames_2/latest edit offsets.rb by adding
"iPhone 14 Pro Max": { "offset": "+81+68", "width": 1290 }, "iPhone 14 Pro Max Black": { "offset": "+81+68", "width": 1290 }

3 added the following line to device_types.rb in the fastlane gem
IPHONE_14_PRO_MAX ||= Frameit::Device.new("iphone14-pro-max", "Apple iPhone 14 Pro Max", 11, [[1290, 2796], [2796, 1290]], 458, Color::BLACK, Platform::IOS)

Not sure if (3) was necessary, as I had to do (2) after that anyway to get things working. but since it was in the same directory as the step 1 I ordered them like such.

@fith
Copy link

fith commented May 17, 2023

^I'm having trouble even with that method. Things aren't sizing correctly.

But this is also a bump to say the Facebook library is updated.
All the colors and styles of iPhone 14 / Plus / Pro / Max.

https://design.facebook.com/toolsandresources/devices/

@RodrigoExtremoTabares
Copy link

I'm quite new to fastlane and the lack iPhone 14 Pro Max support is giving me trouble. Can anyone give some instructions on how the hack works? As the change of offset.json doesn't work for me

@fith
Copy link

fith commented May 31, 2023 via email

@RodrigoExtremoTabares
Copy link

My problem is that even with these steps, I keep getting the error message:
[✔] 🚀
[13:17:37]: Using device frames version 'latest'
[13:17:37]: Unsupported screen size [1290, 2796] for path './Simulator Screenshot - iPhone 14 Plus -SPLASH_framed_resized.png'

I have modified the offset.json, added the images but still getting the error. What am I missing?

@yonicsurny
Copy link

You forgot this step:

  • Add the following line to device_types.rb in the fastlane gem
IPHONE_14_PRO_MAX ||= Frameit::Device.new("iphone14-pro-max", "Apple iPhone 14 Pro Max", 11, [[1290, 2796], [2796, 1290]], 458, Color::BLACK, Platform::IOS)

@yonicsurny
Copy link

Update device_types.rb

  • Find the location of the lib
    fastlane frameit --version
    # example output
    /Users/me/.gem/ruby/2.6.0/gems/fastlane-2.212.1/bin/fastlane
  • In Finder navigate to /Users/me/.gem/ruby/2.6.0/gems/fastlane-2.212.1/frameit/lib/frameit and open device_types.rb
  • Add the following
    IPHONE_14_PRO ||= Frameit::Device.new("iphone14-pro", "Apple iPhone 14 Pro", 11, [[1179, 2556], [2556, 1179]], 458, Color::BLACK, Platform::IOS)
    IPHONE_14_PRO_MAX ||= Frameit::Device.new("iphone14-pro-max", "Apple iPhone 14 Pro Max", 11, [[1290, 2796], [2796, 1290]], 458, Color::BLACK, Platform::IOS)

@yonicsurny
Copy link

You can also have a look at https://github.com/joshluongo/frameme, which I'm seriously considering to use instead of frameit

@RodrigoExtremoTabares
Copy link

It was the device_types change that I was missing, great answer @yonicsurny as I was quite lost with Ruby.
Thank you!

@aehlke
Copy link

aehlke commented Jun 1, 2023

FrameKit is another alternative: https://github.com/ainame/FrameKit you compose layouts in SwiftUI

@saamerm
Copy link

saamerm commented Sep 24, 2023

Update device_types.rb

  • Find the location of the lib

    fastlane frameit --version
    # example output
    /Users/me/.gem/ruby/2.6.0/gems/fastlane-2.212.1/bin/fastlane
  • In Finder navigate to /Users/me/.gem/ruby/2.6.0/gems/fastlane-2.212.1/frameit/lib/frameit and open device_types.rb

  • Add the following

    IPHONE_14_PRO ||= Frameit::Device.new("iphone14-pro", "Apple iPhone 14 Pro", 11, [[1179, 2556], [2556, 1179]], 458, Color::BLACK, Platform::IOS)
    IPHONE_14_PRO_MAX ||= Frameit::Device.new("iphone14-pro-max", "Apple iPhone 14 Pro Max", 11, [[1290, 2796], [2796, 1290]], 458, Color::BLACK, Platform::IOS)

Following @yonicsurny I had to go to /opt/homebrew/Cellar/fastlane/2.216.0/libexec/gems/fastlane-2.216.0/bin/fastlane instead of the location he mentioned since I installed my fast lane using home-brew. And then after adding those two lines, it also required me to run fastlane frameit download_frames first
But then I got this error "Couldn't find template for screenshot type 'Apple iPhone 14 Pro Black'"

@aehlke
Copy link

aehlke commented Sep 25, 2023

I tried to combine FrameKit (for laying screenshots out into app store screenshot frames of various sizes, composing screenshots and anything else you want via SwiftUI) and ShotPlan (for running testplan for taking screenshots across devices/platforms). It works for me and here is my synthesis of the two: https://github.com/lake-of-fire/FramedScreenshotsTool but I haven't documented it

@Starsky89
Copy link

@mindthefrog I've solved it in #20917 using the frame as a mask, that way the screenshot will be clipped automatically and not "bleed" outside of the frame.

@image = frame.composite(image, "png", frame) do |c|

Thanks @guidev. I had seen and tried your change before posting. I am probably doing something wrong but that change does not work for me. Not only are the corners still visible beyond the frame, the screen itself is another copy of the frame with a black screen. This is on the most recent macOS.

Can masking the screenshot with the frame really work? The frames seem to be transparent both inside and outside the bezel. I am probably missing something but it's not working for me?

My solution for now is to run a script that rounds the iPhone 14 screenshot corners before I run frameit.

Can you please post here the script which rounds the corners of the 14 Pro Max before running frameit?
I've been trying to make it work for the last 8 hours and my script isn't doing its job. I don't know much Ruby, and I find it hard to make it work.
I will really appreciate your help.

@mindthefrog
Copy link

Can you please post here the script which rounds the corners of the 14 Pro Max before running frameit? I've been trying to make it work for the last 8 hours and my script isn't doing its job. I don't know much Ruby, and I find it hard to make it work. I will really appreciate your help.

Yeah no problem.

It's not very elegant. It's a simple shell script that rounds the corners using convert which I run before executing frameit. It goes something like this:

#!/bin/zsh

find $1 -not -name *_framed.png -name iPhone\ 14*.png
-exec echo rounding {}
;
-exec convert {}
( +clone -alpha extract
-draw 'fill black polygon 0,0 0,50 50,0 fill white circle 50,50 50,0'
( +clone -flip ) -compose Multiply -composite
( +clone -flop ) -compose Multiply -composite
) -alpha off -compose CopyOpacity -composite {}
;

@Starsky89
Copy link

Starsky89 commented Sep 28, 2023

@mindthefrog
Thank you. Initially your script didn't want to work. I used your code plus a lot of ChatGPT trial and error until I found a working solution.

Here is a final code if someone is looking for the same script. Create a Makefile, put the code below in it:

process_images:
	find ./screenshots/ -not -name '*_framed.png' -name '*-Screen.png' \
	-exec echo rounding {} \; \
	-exec convert {} '(' +clone -alpha extract -draw 'fill black polygon 0,0 0,45 45,0 fill white circle 45,45 45,0' '(' +clone -flip ')' -compose Multiply -composite '(' +clone -flop ')' -compose Multiply -composite ')' -alpha off -compose CopyOpacity -composite {} \;

.PHONY: process_images

Explanation:

  • find ./screenshots/ finds only in this directory recursively
  • -not name '_framed.png' ignores filenames which contain "_framed.png" at the end (the already framed files)
  • -name '*-Screen.png' search only files which end in "-Screen.png" (that's how I name my original screenshots)

Place this Makefile script in the same directory as your project (where your .xcodeproj resides).
Then, in terminal, navigate to the directory with your Makefile and run this command:
make process_images

@sathoeni
Copy link
Contributor

@mindthefrog I've solved it in #20917 using the frame as a mask, that way the screenshot will be clipped automatically and not "bleed" outside of the frame.

@image = frame.composite(image, "png", frame) do |c|

@guidev Tried that locally and on the CI with the latest version of ImageMagick as well with ImageMagick v6.
Unfortunately none of them works, the generated framed screenshots are just containing the frame without a screenshot
e.g.

iPad-11 0-1 Home_framed

@sathoeni sathoeni mentioned this issue Dec 14, 2023
6 tasks
@Starsky89
Copy link

After 3 months, I "cooked" another app update, and I needed to make screenshots again.
Some things were broken, since I updated "fastlane", and also I made the mistake to run the default fastlane frameit download_frames. This all messed up my previous setup.
I am writing here the steps I needed to take to fix it and make it work once again, as a reminder for my future self, and also for others who can't figure it out:

1. Prepare your screenshots for iPhone 14 Pro Max (Portrait 1290x2796)
2. Use the Makefile described previously to round the corners for the iPhone 14 Pro Max screenshots.

@mindthefrog Thank you. Initially your script didn't want to work. I used your code plus a lot of ChatGPT trial and error until I found a working solution.

Here is a final code if someone is looking for the same script. Create a Makefile, put the code below in it:

process_images:
	find ./screenshots/ -not -name '*_framed.png' -name '*-Screen.png' \
	-exec echo rounding {} \; \
	-exec convert {} '(' +clone -alpha extract -draw 'fill black polygon 0,0 0,45 45,0 fill white circle 45,45 45,0' '(' +clone -flip ')' -compose Multiply -composite '(' +clone -flop ')' -compose Multiply -composite ')' -alpha off -compose CopyOpacity -composite {} \;

.PHONY: process_images

Explanation:

* `find ./screenshots/` finds only in this directory recursively

* `-not name '_framed.png'` ignores filenames which contain "_framed.png" at the end (the already framed files)

* `-name '*-Screen.png'` search only files which end in "-Screen.png" (that's how I name my original screenshots)

Place this Makefile script in the same directory as your project (where your .xcodeproj resides). Then, in terminal, navigate to the directory with your Makefile and run this command: make process_images

3. In Terminal, type this command gem which fastlane to find out what fastlane version you're using.
4. Go to Finder -> Go -> Go to folder... and go to your fastlane version folder, ex.: /Users/username/.rvm/gems/ruby-3.0.2/gems/fastlane-2.217.0/ then navigate to frameit/lib/frameit/
5. Replace the file device_types.rb content with the following:

require_relative 'module'
require_relative './device'
require 'deliver/app_screenshot'

module Frameit
  module Color
    MATTE_BLACK ||= "Matte Black"
    SPACE_GRAY ||= "Space Gray"
    ROSE_GOLD ||= "Rose Gold"
    CLEARLY_WHITE ||= "Clearly White"
    JUST_BLACK ||= "Just Black"
    NOT_PINK ||= "Not Pink"
    SILVER_TITANIUM ||= "Silver Titanium"
    ARCTIC_SILVER ||= "Arctic Silver"
    CORAL_BLUE ||= "Coral Blue"
    MAPLE_GOLD ||= "Maple Gold"
    MIDNIGHT_BLACK ||= "Midnight Black"
    MIDNIGHT_GREEN ||= "Midnight Green"
    ORCHID_GRAY ||= "Orchid Gray"
    BURGUNDY_RED ||= "Burgundy Red"
    LILAC_PURPLE ||= "Lilac Purple"
    SUNRISE_GOLD ||= "Sunrise Gold"
    TITANIUM_GRAY ||= "Titanium Gray"
    FLAMINGO_PINK ||= "Flamingo Pink"
    PRISM_BLACK ||= "Prism Black"
    PRISM_BLUE ||= "Prism Blue"
    PRISM_GREEN ||= "Prism Green"
    PRISM_WHITE ||= "Prism White"
    CERAMIC_WHITE ||= "Ceramic White"
    OH_SO_ORANGE ||= "Oh So Orange"
    AURA_BLACK ||= "Aura Black"
    AURA_GLOW ||= "Aura Glow"
    AURA_PINK ||= "Aura Pink"
    AURA_RED ||= "Aura Red"
    AURA_WHITE ||= "Aura White"
    AURA_BLUE ||= "Aura Blue"
    CORAL ||= "Coral"
    BLACK ||= "Black"
    WHITE ||= "White"
    GOLD ||= "Gold"
    SILVER ||= "Silver"
    BLUE ||= "Blue"
    RED ||= "Red"
    YELLOW ||= "Yellow"
    GREEN ||= "Green"
    PINK ||= "Pink"
    PURPLE ||= "Purple"
    GRAPHITE ||= "Graphite"
    PACIFIC_BLUE ||= "Pacific Blue"
    MIDNIGHT ||= "Midnight"
    STARLIGHT ||= "Starlight"
    SIERRA ||= "Sierra"
    SORTA_SAGE ||= "Sorta Sage"

    def self.all_colors
      Color.constants.map { |c| Color.const_get(c).upcase.gsub(' ', '_') }
    end
  end

  module Orientation
    PORTRAIT ||= "PORTRAIT"
    LANDSCAPE ||= "LANDSCAPE"
  end

  module Platform
    ANDROID ||= "ANDROID"
    IOS ||= "IOS"
    ANY ||= "ANY"

    def self.all_platforms
      Platform.constants.map { |c| Platform.const_get(c) }
    end

    def self.symbol_to_constant(symbol)
      if symbol == :android
        ANDROID
      else
        IOS
      end
    end
  end

  module Devices
    GOOGLE_PIXEL_3 ||= Frameit::Device.new("google-pixel-3", "Google Pixel 3", 7, [[1080, 2160], [2160, 1080]], 443, Color::JUST_BLACK, Platform::ANDROID)
    GOOGLE_PIXEL_3_XL ||= Frameit::Device.new("google-pixel-3-xl", "Google Pixel 3 XL", 7, [[1440, 2960], [2960, 1440]], 523, Color::JUST_BLACK, Platform::ANDROID)
    # Google Pixel 4's priority should be higher than Samsung Galaxy S10+ (priority 8):
    GOOGLE_PIXEL_4 ||= Frameit::Device.new("google-pixel-4", "Google Pixel 4", 9, [[1080, 2280], [2280, 1080]], 444, Color::JUST_BLACK, Platform::ANDROID)
    GOOGLE_PIXEL_4_XL ||= Frameit::Device.new("google-pixel-4-xl", "Google Pixel 4 XL", 9, [[1440, 3040], [3040, 1440]], 537, Color::JUST_BLACK, Platform::ANDROID)
    GOOGLE_PIXEL_5 ||= Frameit::Device.new("google-pixel-5", "Google Pixel 5", 10, [[1080, 2340], [2340, 1080]], 432, Color::JUST_BLACK, Platform::ANDROID)
    HTC_ONE_A9 ||= Frameit::Device.new("htc-one-a9", "HTC One A9", 6, [[1080, 1920], [1920, 1080]], 441, Color::BLACK, Platform::ANDROID)
    HTC_ONE_M8 ||= Frameit::Device.new("htc-one-m8", "HTC One M8", 3, [[1080, 1920], [1920, 1080]], 441, Color::BLACK, Platform::ANDROID)
    HUAWEI_P8 ||= Frameit::Device.new("huawei-p8", "Huawei P8", 5, [[1080, 1920], [1920, 1080]], 424, Color::BLACK, Platform::ANDROID)
    MOTOROLA_MOTO_E ||= Frameit::Device.new("motorola-moto-e", "Motorola Moto E", 3, [[540, 960], [960, 540]], 245, Color::BLACK, Platform::ANDROID)
    MOTOROLA_MOTO_G ||= Frameit::Device.new("motorola-moto-g", "Motorola Moto G", 4, [[1080, 1920], [1920, 1080]], 401, nil, Platform::ANDROID, nil)
    NEXUS_4 ||= Frameit::Device.new("nexus-4", "Nexus 4", 7, [[768, 1280], [1820, 768]], 318, nil, Platform::ANDROID)
    NEXUS_5X ||= Frameit::Device.new("nexus-5x", "Nexus 5X", 7, [[1080, 1920], [1920, 1080]], 423, nil, Platform::ANDROID)
    NEXUS_6P ||= Frameit::Device.new("nexus-6p", "Nexus 6P", 7, [[1440, 2560], [2560, 1440]], 518, nil, Platform::ANDROID)
    NEXUS_9 ||= Frameit::Device.new("nexus-9", "Nexus 9", 7, [[1536, 2048], [2048, 1536]], 281, nil, Platform::ANDROID)
    SAMSUNG_GALAXY_GRAND_PRIME ||= Frameit::Device.new("samsung-galaxy-grand-prime", "Samsung Galaxy Grand Prime", 5, [[540, 960], [960, 540]], 220, Color::BLACK, Platform::ANDROID)
    SAMSUNG_GALAXY_NOTE_5 ||= Frameit::Device.new("samsung-galaxy-note-5", "Samsung Galaxy Note 5", 5, [[1440, 2560], [2560, 1440]], 518, Color::BLACK, Platform::ANDROID)
    SAMSUNG_GALAXY_NOTE_10 ||= Frameit::Device.new("samsung-galaxy-note-10", "Samsung Galaxy Note 10", 6, [[1080, 2280], [2280, 1080]], 401, Color::AURA_BLACK, Platform::ANDROID)
    SAMSUNG_GALAXY_NOTE_10_PLUS ||= Frameit::Device.new("samsung-galaxy-note-10-plus", "Samsung Galaxy Note 10+", 7, [[1440, 3040], [3040, 1440]], 498, Color::AURA_BLACK, Platform::ANDROID)
    SAMSUNG_GALAXY_S_DUOS ||= Frameit::Device.new("samsung-galaxy-s-duos", "Samsung Galaxy S Duos", 3, [[480, 800], [800, 480]], 233, nil, Platform::ANDROID)
    SAMSUNG_GALAXY_S3 ||= Frameit::Device.new("samsung-galaxy-s3", "Samsung Galaxy S3", 3, [[720, 1280], [1280, 720]], 306, nil, Platform::ANDROID)
    SAMSUNG_GALAXY_S5 ||= Frameit::Device.new("samsung-galaxy-s5", "Samsung Galaxy S5", 3, [[1080, 1920], [1920, 1080]], 432, Color::BLACK, Platform::ANDROID)
    SAMSUNG_GALAXY_S7 ||= Frameit::Device.new("samsung-galaxy-s7", "Samsung Galaxy S7", 4, [[1440, 2560], [2560, 1440]], 577, Color::BLACK, Platform::ANDROID)
    SAMSUNG_GALAXY_S8 ||= Frameit::Device.new("samsung-galaxy-s8", "Samsung Galaxy S8", 5, [[1440, 2960], [2960, 1440]], 570, Color::MIDNIGHT_BLACK, Platform::ANDROID)
    SAMSUNG_GALAXY_S9 ||= Frameit::Device.new("samsung-galaxy-s9", "Samsung Galaxy S9", 6, [[1440, 2960], [2960, 1440]], 570, Color::MIDNIGHT_BLACK, Platform::ANDROID)
    SAMSUNG_GALAXY_S10 ||= Frameit::Device.new("samsung-galaxy-s10", "Samsung Galaxy S10", 7, [[1440, 3040], [3040, 1440]], 550, Color::PRISM_BLACK, Platform::ANDROID)
    SAMSUNG_GALAXY_S10_PLUS ||= Frameit::Device.new("samsung-galaxy-s10-plus", "Samsung Galaxy S10+", 8, [[1440, 3040], [3040, 1440]], 522, Color::PRISM_BLACK, Platform::ANDROID)
    XIAOMI_MI_MIX_ALPHA ||= Frameit::Device.new("xiaomi-mi-mix-alpha", "Xiaomi Mi Mix Alpha", 1, [[2088, 2250], [2250, 2088]], 388, nil, Platform::ANDROID)
    IPHONE_5S ||= Frameit::Device.new("iphone-5s", "Apple iPhone 5s", 2, [[640, 1096], [640, 1136], [1136, 600], [1136, 640]], 326, Color::SPACE_GRAY, Platform::IOS, Deliver::AppScreenshot::ScreenSize::IOS_40, :use_legacy_iphone5s)
    IPHONE_5C ||= Frameit::Device.new("iphone-5c", "Apple iPhone 5c", 2, [[640, 1136], [1136, 640]], 326, Color::WHITE)
    IPHONE_SE ||= Frameit::Device.new("iphone-se", "Apple iPhone SE", 3, [[640, 1096], [640, 1136], [1136, 600], [1136, 640]], 326, Color::SPACE_GRAY, Platform::IOS, Deliver::AppScreenshot::ScreenSize::IOS_40)
    IPHONE_6S ||= Frameit::Device.new("iphone-6s", "Apple iPhone 6s", 4, [[750, 1334], [1334, 750]], 326, Color::SPACE_GRAY, Platform::IOS, Deliver::AppScreenshot::ScreenSize::IOS_47, :use_legacy_iphone6s)
    IPHONE_6S_PLUS ||= Frameit::Device.new("iphone-6s-plus", "Apple iPhone 6s Plus", 4, [[1242, 2208], [2208, 1242]], 401, Color::SPACE_GRAY, Platform::IOS, Deliver::AppScreenshot::ScreenSize::IOS_55, :use_legacy_iphone6s)
    IPHONE_7 ||= Frameit::Device.new("iphone-7", "Apple iPhone 7", 5, [[750, 1334], [1334, 750]], 326, Color::MATTE_BLACK, Platform::IOS, Deliver::AppScreenshot::ScreenSize::IOS_47, :use_legacy_iphone7)
    IPHONE_7_PLUS ||= Frameit::Device.new("iphone-7-plus", "Apple iPhone 7 Plus", 5, [[1242, 2208], [2208, 1242]], 401, Color::MATTE_BLACK, Platform::IOS, Deliver::AppScreenshot::ScreenSize::IOS_55, :use_legacy_iphone7)
    IPHONE_8 ||= Frameit::Device.new("iphone-8", "Apple iPhone 8", 6, [[750, 1334], [1334, 750]], 326, Color::SPACE_GRAY)
    IPHONE_8_PLUS ||= Frameit::Device.new("iphone-8-plus", "Apple iPhone 8 Plus", 6, [[1242, 2208], [2208, 1242]], 401, Color::SPACE_GRAY)
    IPHONE_X ||= Frameit::Device.new("iphone-X", "Apple iPhone X", 7, [[1125, 2436], [2436, 1125]], 458, Color::SPACE_GRAY, Platform::IOS, Deliver::AppScreenshot::ScreenSize::IOS_58, :use_legacy_iphonex)
    IPHONE_XS ||= Frameit::Device.new("iphone-XS", "Apple iPhone XS", 8, [[1125, 2436], [2436, 1125]], 458, Color::SPACE_GRAY, Platform::IOS, Deliver::AppScreenshot::ScreenSize::IOS_58, :use_legacy_iphonexs)
    IPHONE_XR ||= Frameit::Device.new("iphone-XR", "Apple iPhone XR", 8, [[828, 1792], [1792, 828]], 326, Color::SPACE_GRAY, Platform::IOS, Deliver::AppScreenshot::ScreenSize::IOS_65, :use_legacy_iphonexsmax)
    IPHONE_XS_MAX ||= Frameit::Device.new("iphone-XS-Max", "Apple iPhone XS Max", 8, [[1242, 2688], [2688, 1242]], 458, Color::SPACE_GRAY, Platform::IOS, Deliver::AppScreenshot::ScreenSize::IOS_65, :use_legacy_iphonexsmax)
    IPHONE_11 ||= Frameit::Device.new("iphone-11", "Apple iPhone 11", 9, [[828, 1792], [1792, 828]], 326, Color::BLACK, Platform::IOS)
    IPHONE_11_PRO ||= Frameit::Device.new("iphone-11-pro", "Apple iPhone 11 Pro", 9, [[1125, 2436], [2436, 1125]], 458, Color::SPACE_GRAY, Platform::IOS)
    IPHONE_11_PRO_MAX ||= Frameit::Device.new("iphone11-pro-max", "Apple iPhone 11 Pro Max", 9, [[1242, 2688], [2688, 1242]], 458, Color::SPACE_GRAY, Platform::IOS)
    IPHONE_12 ||= Frameit::Device.new("iphone-12", "Apple iPhone 12", 10, [[1170, 2532], [2532, 1170]], 460, Color::BLACK, Platform::IOS)
    IPHONE_12_PRO ||= Frameit::Device.new("iphone-12-pro", "Apple iPhone 12 Pro", 10, [[1170, 2532], [2532, 1170]], 460, Color::SPACE_GRAY, Platform::IOS)
    IPHONE_12_PRO_MAX ||= Frameit::Device.new("iphone12-pro-max", "Apple iPhone 12 Pro Max", 10, [[1284, 2778], [2778, 1284]], 458, Color::GRAPHITE, Platform::IOS)
    IPHONE_12_MINI ||= Frameit::Device.new("iphone-12-mini", "Apple iPhone 12 Mini", 10, [[1125, 2436], [2436, 1125]], 476, Color::BLACK, Platform::IOS)
    IPHONE_13 ||= Frameit::Device.new("iphone-13", "Apple iPhone 13", 11, [[1170, 2532], [2532, 1170]], 460, Color::MIDNIGHT, Platform::IOS)
    IPHONE_13_PRO ||= Frameit::Device.new("iphone-13-pro", "Apple iPhone 13 Pro", 11, [[1170, 2532], [2532, 1170]], 460, Color::GRAPHITE, Platform::IOS)
    IPHONE_13_PRO_MAX ||= Frameit::Device.new("iphone13-pro-max", "Apple iPhone 13 Pro Max", 11, [[1284, 2778], [2778, 1284]], 458, Color::GRAPHITE, Platform::IOS)
    IPHONE_13_MINI ||= Frameit::Device.new("iphone-13-mini", "Apple iPhone 13 Mini", 11, [[1080, 2340], [2340, 1080]], 476, Color::MIDNIGHT, Platform::IOS)
    IPHONE_14 ||= Frameit::Device.new('iphone-14', 'Apple iPhone 14', 11, [[2532, 1170], [1170, 2532]], 460, Color::MIDNIGHT, Platform::IOS)
    IPHONE_14_PLUS ||= Frameit::Device.new('iphone-14-plus', 'Apple iPhone 14 Plus', 11, [[2778, 1284], [1284, 2778]], 458, Color::MIDNIGHT, Platform::IOS)
    IPHONE_14_PRO ||= Frameit::Device.new('iphone-14-pro', 'Apple iPhone 14 Pro', 11, [[2556, 1179], [1179, 2556]], 460, Color::BLACK, Platform::IOS)
    IPHONE_14_PRO_MAX ||= Frameit::Device.new("iphone14-pro-max", "Apple iPhone 14 Pro Max", 11, [[1290, 2796], [2796, 1290]], 458, Color::BLACK, Platform::IOS)
    IPAD_10_2 ||= Frameit::Device.new("ipad-10-2", "Apple iPad 10.2", 1, [[1620, 2160], [2160, 1620]], 264, Color::SPACE_GRAY, Platform::IOS)
    IPAD_AIR_2 ||= Frameit::Device.new("ipad-air-2", "Apple iPad Air 2", 1, [[1536, 2048], [2048, 1536]], 264, Color::SPACE_GRAY, Platform::IOS, Deliver::AppScreenshot::ScreenSize::IOS_IPAD)
    IPAD_AIR_2019 ||= Frameit::Device.new("ipad-air-2019", "Apple iPad Air (2019)", 2, [[1668, 2224], [2224, 1668]], 265, Color::SPACE_GRAY, Platform::IOS)
    IPAD_MINI_4 ||= Frameit::Device.new("ipad-mini-4", "Apple iPad Mini 4", 2, [[1536, 2048], [2048, 1536]], 324, Color::SPACE_GRAY)
    IPAD_MINI_2019 ||= Frameit::Device.new("ipad-mini-2019", "Apple iPad Mini (2019)", 3, [[1536, 2048], [2048, 1536]], 324, Color::SPACE_GRAY)
    # this is 1st or 2nd gen of iPad Pro 12.9:
    IPAD_PRO ||= Frameit::Device.new("ipad-pro", "Apple iPad Pro", 3, [[2048, 2732], [2732, 2048]], 264, Color::SPACE_GRAY, Platform::IOS, Deliver::AppScreenshot::ScreenSize::IOS_IPAD_PRO)
    # 3rd generation:
    IPAD_PRO_12_9 ||= Frameit::Device.new("ipadPro129", "Apple iPad Pro (12.9-inch) (3rd generation)", 4, [[2048, 2732], [2732, 2048]], 264, Color::SPACE_GRAY, Platform::IOS, Deliver::AppScreenshot::ScreenSize::IOS_IPAD_PRO_12_9)
    # 4th generation:
    IPAD_PRO_12_9_4 ||= Frameit::Device.new("ipadPro129", "Apple iPad Pro (12.9-inch) (4th generation)", 5, [[2048, 2732], [2732, 2048]], 264, Color::SPACE_GRAY, Platform::IOS, Deliver::AppScreenshot::ScreenSize::IOS_IPAD_PRO_12_9)
    # iPad Pro (10.5-inch) is not in frameit-frames repo, but must be included so that we are backward compatible with PR #15373
    # priority must be lower so that users who didn't copy the frame to their frameit frames folder will not get an error
    # ID and formatted name must be exactly as specified so that device.detect_device() will select this device if the filename includes them
    IPAD_PRO_10_5 ||= Frameit::Device.new("ipad105", "Apple iPad Pro (10.5-inch)", 1, [[1668, 2224], [2224, 1668]], 265, Color::SPACE_GRAY, Platform::IOS, Deliver::AppScreenshot::ScreenSize::IOS_IPAD_10_5)
    IPAD_PRO_11 ||= Frameit::Device.new("ipadPro11", "Apple iPad Pro (11-inch)", 1, [[1668, 2388], [2388, 1668]], 265, Color::SPACE_GRAY, Platform::IOS, Deliver::AppScreenshot::ScreenSize::IOS_IPAD_11)

    MAC ||= Frameit::Device.new("mac", "Apple MacBook", 0, [[1280, 800], [1440, 900], [2560, 1600], [2880, 1800]], nil, Color::SPACE_GRAY, Platform::IOS, Deliver::AppScreenshot::ScreenSize::MAC)

    def self.all_device_names_without_apple
      Devices.constants.map { |c| Devices.const_get(c).formatted_name_without_apple }
    end
  end
end

6. Clone or download -> https://github.com/fastlane/frameit-frames
7. Extract and put latest folder in /Users/youruser/.fastlane/frameit/latest
8. Run in Terminal: bundle exec fastlane run frameit path:'./screenshots'

Enjoy!

@sathoeni
Copy link
Contributor

You can also use the fork/branch mentioned here:
#20917 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.