user990914
user990914

Reputation: 91

How to debug Unity project with iOS simulator?

As somebody said, the Unity project must be run on devices, but that is a lot of trouble. Is there any way to run a project in iOS's simulator?

Upvotes: 6

Views: 5840

Answers (2)

naXa stands with Ukraine
naXa stands with Ukraine

Reputation: 37896

Prerequisites:

  • Mac
  • XCode
  • Unity3D for Mac

Guide:

  1. Go to Edit > Player settings > Inspector > iOS tab. Change the Target SDK to Simulator SDK then build the project again.

    Target SDK

  2. Open Build Settings and switch platform to iOS.

  3. In the same window set Run XCode as Debug, check Development Build and Script Debugging.
  4. Click Build and Run, choose a directory for iOS builds (for example, create a new directory named Build.iOS)
  5. Build's a long process, take a break.

Unity3D documentation - Building your Unity game to an iOS device for testing.

Upvotes: 9

Kay
Kay

Reputation: 13146

It was supported until Unity3D 3.3. and iOS 4.??? But the current release 3.4 crashes. See this posting in Unity3D forum.

Anyway I find it easier to run the project in in editor player for debugging and do real testing on the device. Deploying to iPhone via XCode is always annoyingly slow. So I designed my code to distinguish at startup between device and player like

if (Application.platform == RuntimePlatform.IPhonePlayer) {
    // do what ever you need
} else ...

Working with the abstract factory design pattern or singletons makes it pretty easy.

Upvotes: 0

Related Questions