IPhone app crashes after a few days

I am new to developing IPhone apps and this is my first attempt.


I have made a simple app which has two buttons in it. One button opens a URL and the other opens a Pop-up window.


I am yet to enroll as an apple developer and am testing my application on the physical device by connecting it to Xcode.


When I install the application, it runs properly for a few days in spite of disconnecting it from XCode. However, after a few days, the application does not open and flashes a black blank screen and goes back to the home screen.


When I reconnect it to Xcode and run the same code again on the same Iphone, it again works properly for a few days and then crashes again.

I am unable to understand why is the app behaving in such a manner after a few days and not immediately.


Is there some expiry period for application when one has not signed in as a developer?(The provisioning profile shows expiring soon)If not, can you please guide me as to how to go about troubleshooting this issue?


Kindly give me your esteemed suggestions/comments as I am badly stuck and need to find a solution as soon as possible.


Thanks a lot!

Replies

This is a guess:

You probably have something in your app that allocates memory and never releases it. After some time -- days -- the quantity of memory builds up to the point where the OS terminates your app.


To be sure, you need to look at crash information for your app. When it's attached to Xcode, you can find logs by opening the Devices window, selecting your device, and viewing the logs. There is also a device console log display that you can show at the bottom of the Devices window. Sometimes it shows messages that provide clues.


If it does turn out to be a memory problem, use the Instruments tool that comes with Xcode to identify how the memory is being used.

Just out of curiosity, if it could be a memory leak, dont you think app should again start working once the Iphone is restarted?


As mentioned, my application has only two buttons. One opens a URL, and the other a pop-up window for message. Can pop up cause memory leaks?


I am yet to enroll as a developer. Does Apple have some expiry period for app testing on physical device for unpaid accounts and hence app stops working?

You're right. The failure on restart does sound odd.


If you track down the crash logs, they will probably provide some answers.

(It's *possible* that the 2-day crash and the restart crash are not exactly the same thing. One might be causing the other.)

I'm having the same issuewiththe same symptoms.


I load my app onto my iPhone which works for a few days,

then I'll go to open the app which will show a white screen very quickly then it just closes out.


I've tried restarting my iPhone, which has no effect.


If I relaunch the app using Xcode and it starts working again, then we repeat the process.


I too was curious if there is some sort of expire time for test apps, maybe specific to certificates of free developer accounts?

>maybe specific to certificates of free developer accounts?


Absolutely. Free app provisioning (profiles, not certs, in this case) is valid for one week maximum.

Post not yet marked as solved Up vote reply of KMT Down vote reply of KMT

I think I found the issue


Before all this I tried looking at consoles, crash logs, app logs, Intruments-Activity_Monitor, etc. and none reported an issue.


However, on the iPhone if I look into

[Settings] >> General >>Profiles & Device Mgmt


While the crashes are happening, My Developer App Cerificate is missing.

One I reunthe app from Xcode, it seems to load the certificate back in.


I'm left to assume that it is a limitation of (free) Developer certificates/Profiles for which the apps need to run, are limited to a few days.

>I'm left to assume


No need to assume, as it is current protocol.


It's not a 'few' days, it is 7...one week. Xcode will show you the exact expiration date.


You can only generate 'certificates' with a paid Individual Developer Certificate. Free provisioning uses a profile.


And don't be confused...apps that run an expired free profile don't 'crash' - they simply refuse to run. That's why it is incorrect, pointless and frustrating to look for an 'issue'.


Free provisioning is the equivalent of watching the dev world thru a knothole. It's meant to allow a peek into what's going on for paid developers. Until or unless you commit to a paid dev account, it's best to keep your expectations low, as you are only toe-dipping into what for many others is a much broader discipline. Paying for an account will open a new dimension that can't otherwise be appreciated, so if you're at all inclined, I encourage you to sign up soon.


Free provision notes:

- The profile will be valid for 1 week, after which time you will need to recreate a new one.

- There is a limit to how many apps you can build and test to your device.

- Maximum number of devices allowed not known exactly, but if same as paid account, the limit is 100

- What you can/can't do w/free provisioning is listed here:

https://developer.apple.com/library/ios/documentation/IDEs/Conceptual/AppDistributionGuide/SupportedCapabilities/SupportedCapabilities.html#//apple_ref/doc/uid/TP40012582-CH38-SW1

- If this is about creating an .ipa to manually hand off, select Build For Archiving under the project menu, not ‘Run’.

- *If you have, or plan to have, a paid developer account, be sure to use a unique/different apple ID for each account.

- **Free accounts may experience issues launching apps on the watch for the first time.

Workaround: Launch the app manually on the device and click “Trust” when the security sheet appears. You should then be able to launch the app from Xcode.

Post not yet marked as solved Up vote reply of KMT Down vote reply of KMT

Hi,

I'm having the same issue but I've a paid developer account.


It's a long time that I have the paid account, and didn't know about the free one. I did everything as usual, there is something new? Maybe I wrong some settings from xcode?

Probably I think it's necessary to load to App Store to keep app working on device. But on Android is so simply to have my App working always on local. If I want to create an App only for me why i must pay to load App on the App Store? It's only for me! Why with Xcode is impossible to do the same thing as the Android System? A response is welcome. Thanks.

me too

Personally in my case, not few days but right after detaching the device from xcode. After once app is finished it wont run unless i rebuild via xcode. Ios14 beta with xcode12 beta