# Export Figma Assets to Xcode on a Remote Mac

Canonical: https://figment.so/blog/mac-figma-xcode-asset-export-remote

Export each Figma layer at 1x, 2x and 3x, convert the folder to .xcassets with the Python script below, then preview it in the iOS Simulator. Only the Xcode step needs a Mac, and a $2 day on Figment's Intel Mac VM covers a spot-check.

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](https://developer.apple.com/documentation/xcode/asset-management) 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](https://developer.apple.com/documentation/apple-silicon/porting-your-macos-apps-to-apple-silicon). 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](https://developer.apple.com/xcode/system-requirements/).

## How do I configure Figma export at 1x, 2x and 3x?

Add three export rows per layer. Figma's [Export formats and settings](https://help.figma.com/hc/en-us/articles/13402894554519-Export-formats-and-settings) page is the source of truth. Two rules matter here:

- PNG and JPG accept any scale, including the `1x`, `2x`, `3x` multipliers 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:

1. Select the item on the canvas.
2. In the right panel under Export, add three rows.
3. Row 1: scale `1x`, suffix empty, format PNG. This produces `Name.png`.
4. Row 2: scale `2x`, suffix `@2x`, format PNG. This produces `Name@2x.png`.
5. Row 3: scale `3x`, suffix `@3x`, format PNG. This produces `Name@3x.png`.
6. 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.

```python
#!/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.json` and fills in `filename` only 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`) plus `Icon@2x.png` and `Icon@3x.png`, the script groups them under one `Icon.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.xcassets` to the same repository as the Xcode project and `git pull` on 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 an `scp` command.

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 `.xcassets` and 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 `.xcassets` in git and the Xcode build all agree on the base filename.
- Any renames you made to avoid `@2x` collisions 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](/mac-hosting#intel-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](/mac-hosting#apple-silicon-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:**

- [ICC soft-proof roundtrip in Photoshop on a rented Mac](/blog/mac-icc-softproof-roundtrip-photoshop)
- [Rent a Mac for a one-week video project](/blog/mac-rent-one-week-video-project)
- [Set up a GitHub Actions self-hosted runner on a rented Mac](/blog/mac-github-actions-self-hosted-runner)
