An Adobe Illustrator script for easily exporting your artboards to iOS images assets with the correct directory structure and resolutions.
Both app icons and standard images can be exported easily. App icons are exported in the resolutions required by Apple for iPhone, iPad, Spotlight icon, etc. Normal images are exported with a scale factor (1x, 2x, 3x).
- Import the script into Adobe Illustrator (to make the script appear under the scripts menu). To import the script save both
export_assets_for_iOS.jsx
andjson2.js
scripts into the/Adobe Illustrator CC 2017/Presets/{localization}/Scripts/
folder. Restart Adobe Illustrator for the changes to have effect! - Open the Illustrator file that includes the artboards you want to export.
- Select the script from the scripts menu:
File > Scripts
- Choose the directory where the images should be exported to. This script is designed to fully integrate with the Xcode IDE, so the correct directory would be
Images.xcassets
folder in your Xcode project. - Choose which artboards you want to export as app icons and which as image assets.
For example, if we choose to export the Artboard AppIcon
as an application icon and the Artboard settings
as image the script will create following resources in following directory structure (with export options displayed as above):
Images.xcassets
├── AppIcon.appiconset
│ ├── AppIcon-20.png
│ ├── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├── AppIcon-40.png
│ ├── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├── AppIcon-76.png
│ ├── [email protected]
│ ├── AppIcon-Artwork.png
│ ├── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├── AppIcon-iPad-29.png
│ ├── [email protected]
│ ├── [email protected]
│ └── Contents.json
|── settings.imageset
│ ├── settings.png
│ ├── [email protected]
│ ├── [email protected]
│ └── Contents.json
- The script supports both image sets and app icons.
- For images the corresponding
imageName.imageset
folder is created. For app icons the correspondingappIconName.appiconset
folder is created. - In each folder the
Contents.json
file is created that describes the resources. This way the resources are correctly displayed in Xcode.
This repository is under the MIT license, have a look at the LICENSE
file.