Unity3d always shuts down when launching on iOS - ios

I have a weird bug with my game on iOS platform.
When I build it from xCode it works great no matter how many times I run it. When I leave that build on iPhone 6s for one day it can't be opened anymore. When I click on icon it only shows black screen and then returns to home screen. If I double click menu button, the game is in active tasks and I can see that the game was loaded. But it cant be opened. Its like its always minimised or that graphics are failing.
I am using Unity 5.3.4f1 and graphic api is set to OpenGLES 2.0.
Has anyone else run to a problem like this?
Any suggestions or fix?
Edit:
So after testing it turns out it only happens with build from xCode and not with version that is on app store. So I guess it has something to do with provisioning profiles or similar.

Related

iOS App shows black screen after succesful install on device using Xcode 12.5

I am trying to install an app using Xcode 12.5 on my personal device which is an iPhone 7 plus running iOS 15 underneath.
I got it to work after much hassle by adding iOS 15 device support files, but, after the app installs and launches itself, I get a black screen for like a minute or two and then the app works fine.
However, if I debug it takes approximately 30-40 seconds from jumping to one breakpoint to another and it consumes a lot of time.
I have tried scouring for a lot of information on this but no luck. Any solution for this would be appreciated.
You probably disabled your Splash screen that is why black screen appears.
Go in your LaunchScreen.storyboard file, there you will find a Screen Controller. Make it story board entry point and give it a background color of your choice.

Application launched to a pink screen and a blank screen after built on Xcode and tested on Testflight

I am creating a mobile game application using Unity software. I have already successfully uploaded it onto Google Playstore and there was totally no issues.
However, when I built my game on my MacBook using Xcode, there seems to be a major issue.
Everything was built successfully and after I tested the app on TestFlight, these are the issues that were occurring:
Upon launch, screen was in a magenta/pink color
Took few seconds to load then screen changed to a somewhat grey color
Background music was playing
I clicked certain buttons on the blank screen and it could bring me to the play mode (as I roughly know where the buttons are)
So the main issue is that nothing is showing on my screen but codes wise should be working fine.
I have tried resetting the graphics setting in unity and removed all storyboard related as I am not using any storyboards for launchscreen. I am using Xcode 11.1 and tested on my iPhone X on the latest iOS 13.2
When I first submitted for Apple to review, it was rejected by saying that upon launch there was a blank screen and no information on how to resolve it was given to me
This pink usually is caused by wrong shaders, especially if you are using asset bundle to load assets at runtime, you need to build different copies of asset bundles for different platforms and load the corresponding one.
It's recommended to build an empty project to test your environment, such like different version of Unity Editor, different rendering API settings and so on.
This is due to missing shaders in graphics settings of your project. reset shaders and your game will work fine, i found this effective in my case
Edit/ProjectSettings/Graphics. And Right Click at the top of the inspector page for built-in shaders and choose reset it should fix it for you automatically.

libGDX iOS home button kills the game

I'm developing a libGDX game for Android and iOS (MobiDevelop's RoboVM fork). Android works perfectly, but I have a issue on iOS. When the iPhone home button is pressed to leave the game, and I launch the game again by tapping on icon, the game does not resume from where it was paused, but instead restarts, which means the loading screen is displayed, all assets are reloaded, and the main menu appears. Like a fresh/new start of the app. I do not have any specific configuration for the iOS module in my libgdx project and am using what was pregenerated.
Is it possible to tell iOS that I do not want to kill the process? I want to switch to pause/sleeping mode only.
I found a reason of this problem. I tested it on the real device, therefore I was unable to see a logs. When I switch to simulator and look at the logs, I found a NullPointerException. This was a cause of application crash. When I fix this bug, everything works as I expected. After iPhone home button is pressed, pause() method of com.badlogic.gdx.Screen is called and after rerun the game, it continues from exactly where it stops / pauses.
I learned a lesson: make a tests on simulator at first :-)
While I am entirely unfamiliar with libGDX, I can tell you that except for a few very specific cases (VOIP etc.), you cannot control what iOS does with your app when the home button gets pressed.
Furthermore, it is the responsibility of the developer to save the app's state when the app leaves the foreground since this is not something that is or can be handled automatically in a performant way.

iOS Safari, when running our web-app in stand alone mode, crashes iOS in background

We're developing a web app that extensively uses Cavas 2D for some demos, and is successfully running on both iOS and Android devices. Recently we've added stand-alone mode for iOS devices, so user has to "Add-To-Home-Screen" and run it using screen icon, just like regular app.
What happens recently is that after 10-12 times we start the web app on iPhone4:
Status bar (initially set to 'black') suddenly turns white and we cannot exit Safari (by pressing home button).
If we try to make screen shot (home + power button), shutter sound is played as if screen shot was taken and saved.
If we try to lock the device (power button), screen turns black, but no action after that can bring unlock-screen or any screen for that matter - display remains black.
We can only do reset by pressing home + power for 10 seconds after this point.
If we do not lock the device, web app continuously work with no issues at all, it does not crash, but cannot exit it (double click on home button also has no result).
Has anyone experienced this with their web apps?
Any guidance in how to debug this would be highly appreciated. We've tried using Safari on OSX, connect iPhone to it and use Develop -> iPhone menu but no luck so far.
Thanks in advance!
I would start trying to debug by running XCode with the iPhone connected to the computer.
In XCode open "Organizer" and go to the tab "Devices".
You should see your device there, from which you can view the iOS console. That might be able to tell you what is going wrong with the phone stops responding.
I don't think you have to put the phone in development mode (or be a paid developer) to see the iOS console.

Hello World causes Iphone 5s to freeze

I recently began going through the official Apple documentation and tutorials to learn iPhone development. I got my Iphone 5s a couple of days ago, but the sample ToDo list app that I'm making causes the device to lock up randomly when I try to test on the device. For example, I if I make a chance to the code and build/run it on the device, it will work. However, as I keep updating the code and testing it, eventually it will just open up my app on the device as a complete black screen, and freezes. The home button then no longer works, no touch events work, the only think I can do is to hold Home+lock button until the device shuts down.
This cannot be normal, can it? I mean, its just a basic app, what could be causing it?
Attached is the error that shows in xcode, and also a screenshot of the Iphone when it its frozen. Surprisingly, I was able to use the screenshot functionality on the phone... :/
Please check whether you are using a distribution provisioning profile/certificate to sign the app. If you plan to debug the app on the device (use breakpoints etc.), you should sign it with a development provisioning profile.
It only happens sometimes, so it's not provisioning related.
It causes a message to popup in XCode itself, so it's not code related.
I had the same problems before (not that often really...). What I did was
Restart the device
Remove the app from the device
Clear the project builds (CMD SHIFT K)
Restart XCode.
Build & Run again
I actually haven't seen this for a while. I always thought that they fixed the bug. Hope this helps!

Resources