- Home /
I can run the Unity3D Game through XCode, but can't run it directly through iPad.
I meet a strange problem today. Basically I can install and run my Unity3D in a iOS device through XCode (that generated by Unity3D iOS version). But when I tap the application directly through my iPad/iPhone, it will show the loading screen and then crash (back to the iPad/iPhone interface).
I really don't have any idea why this happend? Can some one help me??
My Unity3D version:
Unity3D Pro iOS 3.1
My iPad version:
iOS 4.2
I found the problem, the loading time is far more than the iOS permission. I think when running through XCode, the iOS will not manage the app so that you can load the Game far more than 10 seconds.
This case is described in Unity $$anonymous$$anual Troubleshooting page: http://unity3d.com/support/documentation/$$anonymous$$anual/TroubleShooting.html#iPhoneTroubleShooting
Answer by Bampf · Dec 31, 2010 at 02:48 PM
I found a thread where someone else cleared up a similar problem by changing Xcode settings: http://www.iphonedevsdk.com/forum/iphone-sdk-development/30834-app-only-crashes-while-not-debugging.html
Basically he had a pointer to a deallocated object somewhere, but the Xcode setting NSZombie kept the object around in order to try and detect such problems.
If a vanilla Unity project generated such a problem it is probably a bug you want to submit to them, along with your project demonstrating the problem. But if you've gone in and edited the Objective-C code for some reason then look first at your edits; you might not be retaining an object that you need to.
Another tip is to look at the logs your app generates on the device. You should see them when you look at your iPad in the Organizer window. That may help you figure out where its crashing.
Thanks for your advice, I check the log and finally find the problem. It is the active time (loading time) of the App that exceed the iOS permitted time -- 10s. I think i have to optimize the scene for loading.
Glad you figured it out. $$anonymous$$aking the very first scene (your game menu?) smaller should help. If you have a big soundtrack file, replace it with a short loop. Change the import settings of any large textures you are using and set their maximum size to something smaller. Some textures can be compressed (probably are by default though). If you can combine lots of small textures into one large texture atlas, that can also help.
Answer by Mani · Dec 31, 2010 at 05:25 PM
I have the same issue at times but have found that by changing the arm under the Targets and in the main Unity iPhone xcode project I'm able to get it to work. Also this post in the Unity forum might help. http://forum.unity3d.com/threads/68443-Trying-to-build-only-for-armv6-causes-a-EXC_BAD_ACCESS
Answer by pepefirst · Jul 13, 2011 at 03:28 PM
The problem is this: if your App is big in size, Xcode kills your App due to the delay in loading it. Read the paragraph "Game runs fine when launched from Xcode and crashes on first level load when launched manually on the device" on this link:http://unity3d.com/support/documentation/Manual/android-troubleshooting.html
Your answer
Follow this Question
Related Questions
Xcode build crashes 0 Answers
How to export to IOS 2 Answers
Unity to xCode to iOS device problem 1 Answer
iOS Xcode "Could not write to device" 2 Answers
Adding plugins to XCode project from the command line 1 Answer