IOS app crashes after not opening for a while

Hello I tested this on two ios devices iphone5s and iphone6+

What happens is right when I open my app it shows the splash screen but then it crashes like .5 seconds after that.
So what I did is I make the application sleep for 25 seconds so I could have enough time to attach the PID to the Xcode debugger. When it attached the app seemed to load fine. I then stopped the process tried to start the app again from my iphone and it still crashes.

It’s weird when it’s connected to the debugger it won’t crash when it’s not it will only after a day of not opening it or so.
Does anyone have a clue of what might be happening.
All help is appreciated thank yoU!

What’s your engine version? I haven’t met that.

Are you using any kind of environment variables ?

The latest one.

@zhangxm is it possible that since I didn’t release the app apple will not let me open it if i don’t play for a while?

Because I made another small game and I installed it on my phone and after a while it didn’t open fully it just went in the app and went out it’s weird.
It’s not like a memory issue because this other small game is not intense.

A couple of days ago i think i might have found the solution I was using log’s i.e cocos2d::log() and I didn’t take it away once i took away I didn’t see the problem YET.

I’m not sure what you mean

No, we always test apps before releasing.

It happened again. I really don’t know what to do here please help.

What’s your engine version? Have you tested cpp-empty-test?

I found a iPhone5s which installed cpp-tests, lua-tests and js-tests a long time ago. Not crash happened.