fastlane: frameit doesn't support iPhone 14 Pro screen size

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

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 4
  • Comments: 39 (7 by maintainers)

Most upvoted comments

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)
    

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) https://github.com/fastlane/frameit-frames/pull/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.

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!

@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

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 😄 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

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 {}
;

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’”

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

Yup, no problem. Fastlane can be annoyingly delicate, but it is still always worth the effort.

This mostly deals with the command fastlane frameit which takes the raw screenshots and adds devices frames, a background image, and some localized text. Docs: https://docs.fastlane.tools/actions/frameit/

I forgot to include some steps. Sorry about that.

Overview:

  1. patching in the missing iphone 14 frames
  2. custom mask script i wrote to deal with iphone 14 corners
  3. run frameit
  4. deliver - upload the screenshots

1. patching in the missing iphone 14 frames fastlane frameit download_frames will download a repository of device frames to your ~/.fastlane/frameit folder. The frames are their own git repo ( https://github.com/fastlane/frameit-frames ) that pull from a Facebook library ( https://design.facebook.com/toolsandresources/devices/ ) The frameit-frames repo is just out of date, but there’s a PR with the newer frames. So just go in to your ~/.fastlane/frameit folder and overwrite your frames folder with a clone at this hash: https://github.com/fastlane/frameit-frames/pull/31

Now you’ll have iPhone 14 frames.

2. custom mask script i wrote to deal with iphone 14 corners There is a problem with the iPhone 14 frames… 😅 The corners of the screen are so rounded that the 90° corner of the screenshot sticks outside the device frame. You can see a conversation about it here: https://github.com/fastlane/fastlane/issues/20703#issuecomment-1271173819

I didn’t find a solution to that online, so I made a mask image, and wrote a Bash ImageMagick script ( cropcorners14promax.sh ) that applies the mask to all the screenshots BEFORE you run frameit. This should be pretty easy to edit to support regular 14 Pro (non-Max). You can add more device names in the Snapfile and re-run fastlane snapshot to generate more. You may have to look up the specific names it’s looking for. (There’s a big array of them somewhere in the fastlane ruby source code.)

run runcrop14promax.sh in the fastlane folder.

  • runcrop14promax.sh finds all the files with “14 Pro Max”
  • it sends each filename to to cropcorners14promax.sh
  • cropcorners14promax.sh applies iphone14promax-mask.png to the alpha channel of the screenshot file

Then you run

3. Now you should be able to run fastlane frameit

Watch the files it’s generating. If it’s doing something weird, cancel it and make an adjustment. Once you have it set up and working you probably won’t have to change anything with the toolchain until a new device size is released.

The downside to that is that it’s hard to remember how it works when it breaks after 6 months. I highly suggest writing your own notes about this, your personal set up, links to the docs and git repos, and what set of commands works for you.

4. deliver

for uploading all the screenshots you use fastlane deliver

There’s a .Deliverfile file that has some comments and options (some are commented out). The options are pretty self explanatory, but it’s worth reading the docs too. http://docs.fastlane.tools/actions/deliver/#deliver

This will update every language with whatever is in the metadata folder for each language (i.e. privacy.txt, description.txt), and the localized screenshots.

It can also upload the build for you… but I never trusted it to do that. I did that manually via XCode -> Build -> Archive -> Upload. Sometimes it takes a few minutes for the build to show up in App Store Connect. I wait until it does, then I run fastlane deliver

That’s a lot… and written quickly. But I think that’s all the missing parts. Sorry I forgot the iPhone 14 support part.

Let me know if you get it working, or have more questions.

Thanks, Kevin

On Wed, May 31, 2023 at 1:48 PM Rodrigo Extremo Tabarés < @.***> wrote:

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

— Reply to this email directly, view it on GitHub https://github.com/fastlane/fastlane/issues/20703#issuecomment-1570930911, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAY5MKBVKUA5XP2CTA23RTXI6VA7ANCNFSM6AAAAAAQV56NXA . You are receiving this because you commented.Message ID: @.***>

^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/

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

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?