Skip to content

Play your own Switch games on iPhone/iPad — one-click macOS app, no terminal. | 把 Switch 游戏装进 iPhone:图形界面一键构建,不用命令行。Bring your own game.

The build script says when it is running under Rosetta (PR #31, item 3)

LNPANDY75f69c04742f
diff --git a/scripts/build_ipa_from_nsp.py b/scripts/build_ipa_from_nsp.py
index b4faba93..83b08ac3 100755
--- a/scripts/build_ipa_from_nsp.py
+++ b/scripts/build_ipa_from_nsp.py
@@ -1926,6 +1926,12 @@ def main(args=None):
keys = Path(os.path.expanduser(args.keys or PROD_KEYS or ask('path of prod.keys: ', 'prod.keys (-k)'))).resolve()
if not nsp_dir.is_dir(): raise BuildError(f'not a folder: {nsp_dir}')
if not keys.is_file(): raise BuildError(f'no such file: {keys}')
+ # An Intel Python (an Intel Homebrew under /usr/local) runs under Rosetta on an Apple silicon Mac, and its children prefer the
+ # x86_64 slice: the shader translator's universal apphost then wants an x86_64 .NET, finds the arm64 one, prints nothing, and
+ # the build stops at the iOS shader step with "xlate_source: lock … / actual" (empty), which reads like a stale translator.
+ # Say so here instead (ufooer's PR #31, item 3).
+ if sys.platform == 'darwin' and subprocess.run(['sysctl', '-n', 'sysctl.proc_translated'], capture_output=True, text=True).stdout.strip() == '1':
+ raise BuildError(f'{sys.executable} is an Intel Python running under Rosetta; run the build with a native arm64 Python (e.g. /usr/bin/python3 or Homebrew in /opt/homebrew)')
sys.path.insert(0, str(repo / 'dm/games')); import game as gamemod # game profiles
global pg; import profile_guess as pg # dm/games: a provisional profile's keys from the game files and from the heap check
sys.path.insert(0, str(repo / 'dm/tools')); global nacp; import nacp # the game name in the NSP's control data
diff --git a/scripts/sync_upstream.py b/scripts/sync_upstream.py
index 6e4ba2de..974e653a 100644
--- a/scripts/sync_upstream.py
+++ b/scripts/sync_upstream.py
@@ -717,6 +717,21 @@ def rmtree(p):
sdk = subprocess.run(['xcrun', '--sdk', 'iphoneos', '--show-sdk-version'], capture_output=True, text=True, env=env)
if sdk.returncode:
raise BuildError('the iOS SDK is not installed (Xcode 15 and later download the platform separately): run xcodebuild -downloadPlatform iOS, or pick it in Xcode → Settings → Components')
+""")]))
+ # An Intel Python under Rosetta (an Intel Homebrew in /usr/local on Apple silicon) has children
+ # that prefer the x86_64 slice: the shader translator's universal apphost then asks for an x86_64
+ # .NET, finds only the arm64 one, prints nothing, and the build stops at the iOS shader step with
+ # an empty "xlate_source: lock … / actual" — which reads like a broken translator. ufooer found
+ # this on an iPad bring-up (PR #31, item 3); saying it up front turns a mystery into a one-line fix.
+ P.append(('Rosetta check', 'is an Intel Python running under Rosetta', [(
+ " if not keys.is_file(): raise BuildError(f'no such file: {keys}')\n",
+ """ if not keys.is_file(): raise BuildError(f'no such file: {keys}')
+ # An Intel Python (an Intel Homebrew under /usr/local) runs under Rosetta on an Apple silicon Mac, and its children prefer the
+ # x86_64 slice: the shader translator's universal apphost then wants an x86_64 .NET, finds the arm64 one, prints nothing, and
+ # the build stops at the iOS shader step with "xlate_source: lock … / actual" (empty), which reads like a stale translator.
+ # Say so here instead (ufooer's PR #31, item 3).
+ if sys.platform == 'darwin' and subprocess.run(['sysctl', '-n', 'sysctl.proc_translated'], capture_output=True, text=True).stdout.strip() == '1':
+ raise BuildError(f'{sys.executable} is an Intel Python running under Rosetta; run the build with a native arm64 Python (e.g. /usr/bin/python3 or Homebrew in /opt/homebrew)')
""")]))
for name, marker, pairs in P:
if marker in t: