Solving Common Unity Xcode Issues
A living guide to Unity and Xcode issues, starting with slow local iOS app launches and the Debug executable setting.
← All articles
TL;DR
- If your Unity iOS app launches or runs slowly through Xcode, try turning off Debug executable under Product > Scheme > Edit Scheme > Run > Info.
- If that helps, the post-build script below applies the setting automatically after Unity exports the iOS project.
- Xcode will launch without its debugger attached. Re-enable the setting when you need native breakpoints, stepping or variable inspection.
- This targets debugger-related launch and runtime delays. It does not speed up C# compilation, IL2CPP conversion or Xcode compilation and linking.
This is a living guide to Unity and Xcode issues. Like my Unity Android Gradle guide and Facebook SDK troubleshooting guide, I'll add to it as more issues come up.
Unity iOS App Running Slowly in Xcode
After recent Xcode updates, I've been seeing Unity iOS builds run extremely slowly when launched locally through Xcode. If you're seeing the same thing, it might not be anything you changed in your Unity project. Check the Debug executable option in the Xcode scheme.
When this is enabled, Xcode attaches its debugger as the app starts. Turning it off can help when that attachment is causing the delay. Apple explains how to run an app without the debugger, and an Apple engineer suggested this check in a discussion about slow Xcode 26 app startup.
The setting itself is not new. That discussion also records debugging improvements in Xcode 26.2 and iOS 26.2, so the result depends on your Xcode version, device OS and project. Treat this as a workaround for a confirmed debugger-related slowdown.
Check the setting manually
- Open your generated project in Xcode, or its
.xcworkspaceif you use CocoaPods. - Select the Unity-iPhone scheme.
- Open Product > Scheme > Edit Scheme.
- Select Run > Info and untick Debug executable.
- Run the app again on the same device and compare its launch time and responsiveness.
If the delay happens while Xcode is compiling or linking, this setting won't address it. If the app is still slow when opened directly on the device, investigate its startup and runtime work too.
Automatically disable Debug executable after a Unity iOS build
If turning it off helps, you can apply the same change after each Unity export. Save this as Assets/Editor/IosSchemePostProcess.cs in your Unity project. The Editor folder keeps it out of the player build.
The script uses Unity's PostProcessBuild callback to update the generated shared Unity-iPhone scheme:
using System.IO;
using System.Xml;
using UnityEditor;
using UnityEditor.Callbacks;
using UnityEngine;
/// <summary>
/// Unchecks "Debug executable" on the Run action of the generated Unity-iPhone Xcode scheme.
/// </summary>
public static class IosSchemePostProcess
{
const string SchemeRelativePath = "Unity-iPhone.xcodeproj/xcshareddata/xcschemes/Unity-iPhone.xcscheme";
const string PosixSpawnLauncher = "Xcode.IDEFoundation.Launcher.PosixSpawn";
[PostProcessBuild(100)]
public static void OnPostProcessBuild(BuildTarget target, string pathToBuiltProject)
{
if (target != BuildTarget.iOS)
return;
var schemePath = Path.Combine(pathToBuiltProject, SchemeRelativePath);
if (!File.Exists(schemePath))
{
Debug.LogWarning($"[IosSchemePostProcess] Scheme not found at {schemePath}");
return;
}
var doc = new XmlDocument { PreserveWhitespace = true };
doc.Load(schemePath);
var launchAction = doc.SelectSingleNode("/Scheme/LaunchAction") as XmlElement;
if (launchAction == null)
{
Debug.LogWarning("[IosSchemePostProcess] LaunchAction not found in scheme.");
return;
}
// "Debug executable" off = empty debugger identifier + PosixSpawn launcher.
launchAction.SetAttribute("selectedDebuggerIdentifier", "");
launchAction.SetAttribute("selectedLauncherIdentifier", PosixSpawnLauncher);
doc.Save(schemePath);
Debug.Log("[IosSchemePostProcess] Disabled 'Debug executable' in Unity-iPhone scheme.");
}
}
Export your iOS project again, then check Run > Info in Xcode to confirm the checkbox is off. The script expects the shared scheme at the path shown above. If you've renamed the project or use a custom scheme, update SchemeRelativePath. A missing scheme or LaunchAction produces a warning and leaves the file unchanged.
What do you lose by disabling Debug executable?
The main trade-off is native debugging. Without Xcode's debugger attached, native breakpoints won't stop execution, and you can't step through native code or inspect variables in LLDB. That matters when diagnosing an iOS plugin, Objective-C or Swift integration, or generated IL2CPP code. You also lose the attached debugger's immediate view of a crash.
This changes the scheme's Run action. It doesn't switch the build configuration to Release, change Unity's Development Build or Script Debugging options, or change the scheme's Archive action. Unity's managed debugging settings are separate.
For ordinary local testing, that can be a useful trade-off. When you need Xcode's debugger, tick Debug executable again before running. The script will turn it off on the next Unity iOS export, so remove or temporarily disable the callback if you want the setting to stay enabled.
Related Unity troubleshooting
If an iOS issue is holding up your project, get in touch. Platform integration and release support are part of our Unity mobile development work.