Skip to content

Instantly share code, notes, and snippets.

@terhechte
Created October 23, 2016 20:59
Show Gist options
  • Save terhechte/4394942c84f79bd9b5a3835fb896c561 to your computer and use it in GitHub Desktop.
Save terhechte/4394942c84f79bd9b5a3835fb896c561 to your computer and use it in GitHub Desktop.
Fill Xcode Product with unused space so the app looks bigger than it is
# What crazy talk is this?
# See: https://twitter.com/myell0w/status/790245699694854145
#
# In a world where everything has to be bigger, faster, higher and more,
# users seem to have developed the expectation that the bigger the software
# package, the better the software. However, if you fill up your binary with
# useless data, the app store size might be too high and your app will
# require download over wifi.
#
# The following script can be added to your Xcode target as a shell script.
# It will generate a (customizable) 42MB file and copy it into your target
# once the build is finished.
#
# Here's the kicker: The generated file will contain only null values, so:
#
# A 42MB file compressed (zip) down to 39kb.
#
# This means that your calculated app store size will be low, and your
# app store download will be fast, but the size of the app on the users
# device (the size he can see either in Finder or in the iOS settings)
# will be 42MB bigger.
#
# Without further ado, here it is:
export FILE_SIZE="42m" # the megabyte size of the file
export FILE_NAME="database.db" # the name of the generated file
dd if=/dev/zero of=${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.app/$FILE_NAME bs=$FILE_SIZE count=1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment