Why do changes not build when I build and run?

I can build and run once…unless I delete the xcode project, future changes, and build and run commands result in the remote running the same version that was run the very first time. I can add scripts, objects, move things around, and none of it shows up on the iPhone. It’s not until I delete the entire project that the updated game shows up on the device. What am I doing wrong?

Try Build/Clean in xcode. Sometimes that’s necessary for some reason.

The problem is that when I do that I get run-time errors and the program never will launch again.

I’ve written several non-Unity iPhone apps with XCode and this is the first time I’ve seen this problem.

Hi,

what kind of runtime errors do you get? Is there anything in XCode Console?

Here’s the errors I get:

Uncaught Exception:
-[PBXDebugScriptCommand debugSessionDidStart]: unrecognized selector sent to instance 0x2011ba900

Stack Backtrace:
The stack backtrace has been logged to the console.

I can run the program but have to click Continue first.

Also, many times XCode just hangs there. I have to Force Quit it to continue.

This is still an issue by the way with any Unity project I create, no matter the location.

The first time I select build and run it asks for the folder name to use. It then creates the project in xcode but has “Missing” set as the device. I change the device to “Device - 3.0” and it builds.

If I make any changes and unity and re-do build and run it compiles it in Unity, then runs it in XCode where it promptly plays the “old” version.

If I close the XCode project, delete the folder, and then go through the steps above again it works. This is quite painful.

If I do a Clean and then do a build, it compiles but when I run it I get a thrown exception error before running. It will run, but only after I continue with the error.

Another fun fact is that half the time, after the first build, XCode will hang on building or closing any Unity project and I have to do a Force Quit in OS/X to get it to stop whatever it is doing.

I’ve been using XCode for over a year and doing iPhone development so I’m not new to XCode but I am new to Unity. What am I doing wrong that keeps me from quickly iterating on my device? Is Unity just so buggy that you can’t quickly check changes on the actual hardware?

what’s ur environment?

Is it XCode3.2 Snow leopard?

Yeah, Snow Leopard and XCode 3.2. I read there were some problems but nothing about this particular issue. I’m hoping I’m just doing something stupid and clicking the wrong button somewhere?

I am clicking Build Run from Unity. The first time it creates the XCode project (I am putting it in the root folder for the project, not in the assets folder) but sets the device to Missing. I change the device to Device - 3.0 which then works for the rest of the time but it no longer takes any of my changes. I see the progress bar in Unity and can even use the play controls at the bottom to see that my changes are taking effect in Unity but that is not translating to XCode. Is there a step I’m missing?

Like I said, I’m sure this is a great tool and looks really nice, but something isn’t working right here. I have tried rebooting several times as well by the way.

Thanks for the help.

No, I get this problem to with Xcode 3.2 and Snow Leopard too, so you’re not the only one. I filed a bug report about it, so the Unity guys should know about it.

edit: Also, note that this problem doesn’t occur on Leopard with Xcode 3.1, so it’s a Snow Leopard only problem (although, Xcode itself has its own series of problems… the less I have to deal with it, the happier I am).

Doh! Well no wonder. I’m glad I’m not the only one at least. I’m actually suprised more people haven’t talked about the problem.

Thanks a bunch.

well i guess not many people tried to upgrade to snow leopard yet. but this is surely a bug and need to be fixed asap.

yeah. i’m building my app in iphone sdk 2.1 for backward compatibility.

anyway, under xcode3.2+snow leopard environment, my current approach to avoid this issue is like this:

  1. always close a current xcode window before starting to build in Unity.

  2. once unity finish building the app and starts the xCode, let xcode build the app. the xcode will build and run correctly, but in fact it’s your old build.

  3. now clean the build. (cleaning option becomes unavailable or xcode hangs in many cases without following those steps)

  4. now build and run again. now you’ll see the xcode builds and runs the game, but the game crashes as soon as it starts

  5. the thing is the game is actually installed on your iphone correctly, so you’ll be able to play it without any issue!! (… but no debugging)

Again, may be my Snow Leo machine has some kind of magic inside, but I cannot suffer from not updated projects issue.

my steps are like:

  1. close xcode, open unity, open project
  2. press build&run, select right SDK instead of Missing | Smth, see my App on device
  3. do some basic changes like move figure to another corner or edit some settings
  4. press build&run, see app installing to device, see my recent changes on board

I am using Snow Leo, SDK 3.1, Xcode 3.2, iPhone 3GS

hey there!

unfortunately this is definitely NOT a snow-leopard only issue. i have a the similar problem with leopard.

_software
3.14 xcode
1.5.0 f3 iPhone basic
10.5.8 os x

_platform
ipodtouch (os 2.2.1)
iphone 3g (os 3.1)

“Unity respects your XCode project now. It is not overwritten anymore by default.” → this feature seems to be a bug right now…

I’m also constantly seeing this problem. It’s really slowing me down. I have to force quit XCode 5-10 times a day if I forget to shut it down after each run. Since I’m doing native Obj-C and networking - this is for every build/test cycle. Does anyone have a workaround for this yet? Maybe writing some AppleScript to do a “Touch” or “Clean” or something like that during the project launch? BTW - how does Unity control that build process? If it’s an AppleScript somewhere maybe we can hack it up…

I’m running Snow Leopard, XCode 3.2 - I have the unity set to “Append” not replace my project…

Same here :frowning: Pretty annyoing.

I also have this exact same problem. Using Snow Leopard and all the latest versions:

unity iphone basic 1.5.0f3
sdk 3.1
xcode 3.2
ipod touch 3.1.1

I also get the “unrecognized selector” exception. After clicking continue it works though and has installed correctly on the ipod touch.

If I don’t clean/rebuild I get the old version of my app.

OK. Just give me a descent steps to reproduce the issue and it will be fixed with the next 1.5.1 release. We cannot fix the case until we are able to reproduce it.

To watch it not update

  1. Build and Run from Unity
  2. Enter name of project
  3. XCode creates project but with “Missing” as the device name
  4. Select device
  5. Click build and run in XCode
  6. Watch app run
  7. Exit app
  8. Change something in unity (scale something)
  9. Build and Run from Unity
  10. Watch your game build and run with no changes visible

To watch it update

  1. Build and Run from Unity
  2. Enter name of project
  3. XCode creates project but with “Missing” as the device name
  4. Select device
  5. Click build and run
  6. Watch app run
  7. Exit app
  8. Change something in unity (scale something)
  9. Close the XCode project
  10. Delete the XCode project folder
  11. Build and Run from Unity
  12. Enter name of project
  13. XCode creates project but with “Missing” as the device name
  14. Select device
  15. Click build and run in XCode
  16. Watch app run as it should

Hmm. Not much to do to reproduce this. I started with the Bonjour sample. Build this sample from Unity and deploy/run using your device. It will launch XCode, build, deploy and run just fine. Then go back and modify one of the functions in Bonjour.cs to do something obviously different. Select “CMD-B” to build/run the project. Unity will regen whatever it does for the scene (use the Append not Replace project BTW). Then XCode will close/re-open and (in my case) it will immediately re-run the out of date executable. No exceptions - it NEVER performs the typical build/deploy/run cycle. I have to manually stop this GDB session, then click Build&Run to make it recompile. Sometimes it will just stick on the “Building…” stage if I don’t manually quit out of XCode. The IDE is not completely un-responsive, you can highlight text and stuff, but all of the buttons remain greyed out and menu items don’t do anything… Very weird. I have not seen this behavior with the MacOS server project I’m writing.

Cheers,
Stephen

bump check - I’m seeing other threads start on this now too… Anyone at Unity got a handle on this yet? :slight_smile: