Export each Figma layer at 1x, 2x and 3x, convert the export folder to an Xcode .xcassets bundle with the short Python script below, then open the bundle in Xcode on a rented Mac to preview it in the iOS Simulator. Figma and the script run on Windows, Linux or macOS. Only the Xcode and Simulator step needs macOS.
Which step needs a Mac?
Only Xcode needs one. An Xcode asset catalog is directories and Contents.json files, which any operating system can write. macOS is needed to compile the catalog, validate image sets and launch the iOS Simulator so you can see an asset at a given device scale.
Apple's porting guide says that to run Xcode on an Intel processor you must use Xcode 26 or earlier. The Intel Mac VM runs macOS Sequoia, where Apple lists Xcode 26.0 to 26.3, so it fits asset-catalog validation and any Simulator runtime those versions support. Xcode 26.4 and later, Xcode 27 and visionOS need an Apple silicon plan. Check the macOS and tool versions Figment shows before purchase against Apple's Xcode requirements.
How do I configure Figma export at 1x, 2x and 3x?
Add three export rows per layer. Figma's Export formats and settings page is the source of truth. Two rules matter here:
- PNG and JPG accept any scale, including the
1x,2x,3xmultipliers Apple expects. The suffix field is a plain string appended to the filename. Figma does not add the@for you, so you type it. - SVG and PDF only export at 1x. For vector assets, send one PDF or SVG per symbol and let Xcode scale it. The script below is only for raster PNG and JPG.
For each layer, frame or component you want in the catalog:
- Select the item on the canvas.
- In the right panel under Export, add three rows.
- Row 1: scale
1x, suffix empty, format PNG. This producesName.png. - Row 2: scale
2x, suffix@2x, format PNG. This producesName@2x.png. - Row 3: scale
3x, suffix@3x, format PNG. This producesName@3x.png. - Click Export. For a whole library, multi-select frames and export in one pass. Each frame keeps its own export settings.
If a Figma layer name literally contains @2x or @3x (for example Icon@2x), rename the layer before exporting. Otherwise the converter reads the suffix as a scale.
How do I convert the export folder to .xcassets?
Run the script below. Xcode expects each image set inside .xcassets to look like this:
MyAssets.xcassets/
Contents.json (top-level)
ButtonPrimary.imageset/
Contents.json
ButtonPrimary.png (1x)
ButtonPrimary@2x.png (2x)
ButtonPrimary@3x.png (3x)
The script is an untested reference implementation. Run it on a small test folder first and open the result in Xcode before you point it at a real design library. It needs Python 3.8 or later and the standard library only. It copies files rather than moving them, so your original export stays untouched. On macOS, Python 3 arrives with the Command Line Tools. On Windows it is a separate install from python.org.
#!/usr/bin/env python3
"""figma_to_xcassets.py - Convert a Figma export folder to a .xcassets bundle.
Usage: python3 figma_to_xcassets.py <figma_export_dir> <output.xcassets>
"""
import json, re, shutil, sys
from collections import defaultdict
from pathlib import Path
PATTERNS = [
(re.compile(r"^(.+)@3x\.(png|jpg)$", re.IGNORECASE), "3x"),
(re.compile(r"^(.+)@2x\.(png|jpg)$", re.IGNORECASE), "2x"),
(re.compile(r"^(.+)@1x\.(png|jpg)$", re.IGNORECASE), "1x"),
(re.compile(r"^(.+)\.(png|jpg)$", re.IGNORECASE), "1x"), # bare == 1x
]
def classify(name):
for pattern, scale in PATTERNS:
m = pattern.match(name)
if m:
return m.group(1), scale, m.group(2).lower()
return None
def contents_for(entries):
images = []
for scale in ("1x", "2x", "3x"):
slot = {"idiom": "universal", "scale": scale}
if scale in entries:
slot["filename"] = entries[scale]
images.append(slot)
return {"images": images, "info": {"version": 1, "author": "xcode"}}
def main():
if len(sys.argv) != 3:
sys.exit("Usage: figma_to_xcassets.py <export_dir> <output.xcassets>")
src, out = Path(sys.argv[1]), Path(sys.argv[2])
if not src.is_dir():
sys.exit(f"Not a directory: {src}")
groups = defaultdict(dict)
for f in sorted(src.iterdir()):
if not f.is_file():
continue
r = classify(f.name)
if not r:
continue
base, scale, ext = r
groups[base].setdefault(scale, (f, ext))
if not groups:
sys.exit("No PNG/JPG files found in the export directory.")
out.mkdir(parents=True, exist_ok=True)
(out / "Contents.json").write_text(
json.dumps({"info": {"version": 1, "author": "xcode"}}, indent=2),
encoding="utf-8",
)
for base, scale_map in sorted(groups.items()):
safe = re.sub(r"[^\w\s-]", "", base).strip().replace(" ", "_") or "Asset"
imageset = out / f"{safe}.imageset"
imageset.mkdir(exist_ok=True)
entries = {}
for scale, (src_file, ext) in scale_map.items():
suffix = "" if scale == "1x" else f"@{scale}"
dest_name = f"{safe}{suffix}.{ext}"
shutil.copy2(src_file, imageset / dest_name)
entries[scale] = dest_name
(imageset / "Contents.json").write_text(
json.dumps(contents_for(entries), indent=2), encoding="utf-8",
)
missing = [s for s in ("1x", "2x", "3x") if s not in entries]
tail = f", missing {missing}" if missing else ""
print(f" {imageset.name}: have {sorted(entries)}{tail}")
if __name__ == "__main__":
main()
Edge cases to know before you run it:
- The script always writes 1x, 2x and 3x slots in
Contents.jsonand fills infilenameonly for scales that exist. Xcode flags a missing scale in the catalog editor, so you can add it or switch the image set to Single Scale. - Characters outside letters, digits, underscore, hyphen and whitespace are stripped from folder names so the imageset directory is a valid identifier.
- If a Figma export uses a bare name for 1x (
Icon.png) plusIcon@2x.pngandIcon@3x.png, the script groups them under oneIcon.imageset.
How do I move the bundle to the rented Mac and preview it?
Use git or a file copy over SSH, then open the project in Xcode through remote desktop. The Intel Mac VM and the Dedicated M4 Pro have SSH and encrypted remote desktop; the Apple Silicon Mac VM has SSH and the browser desktop.
- Commit
MyAssets.xcassetsto the same repository as the Xcode project andgit pullon the Mac. This is usually easiest, because the same version lands in source control for the developers. - Or copy the folder from your own machine with
scp -r MyAssets.xcassets <user>@<mac-address>:~/, using the address and login your dashboard shows. Windows 10 and later include anscpcommand.
Once Xcode is installed on the Mac, open your project, right-click the existing Assets.xcassets in the Project navigator, choose Show in Finder, drop the new imagesets next to the existing ones, then build to an iOS Simulator with Cmd+R. If the asset catalog editor flags a missing scale, either add it in Figma and re-export, or toggle the image set to Single Scale in the Attributes Inspector. Remote previews are not colour-calibrated, so check the final build on real hardware before release.
What should pass before I hand off the assets?
Walk through this list before calling the bundle done:
- The output folder opens in Xcode as a single
.xcassetsand every imageset is visible in the Project navigator. - Each image set shows filled slots at the scales you intended, and either a filled or deliberately Single-Scale state for the rest.
- A build to the iOS Simulator succeeds and the asset renders at the expected size on a 2x device (for example iPhone SE) and a 3x device (for example iPhone 15 Pro).
- The design source in Figma, the converted
.xcassetsin git and the Xcode build all agree on the base filename. - Any renames you made to avoid
@2xcollisions are reflected back in the Figma layer names, so the next export stays clean.
What does a designer's asset spot-check cost on a rented Mac?
For a spot-check, rent the Intel Mac VM for a day: $2 a day, or $25 a month, on macOS Sequoia with Xcode 26.3 or earlier. If you preview daily with iOS engineers on a current Xcode, or need Xcode 27 or visionOS, use the Apple Silicon Mac VM at $6 a day or $39 a month. Arithmetic for a designer who previews three afternoons a month: 3 × $2 = $6 a month on daily Intel rentals, against $25 for a monthly plan. We have not measured Simulator speed on any plan, so time your own preview. Billing does not stop when you disconnect.
Related guides: