47

I am new to making 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 works properly again for a few days and then crashes again.

I am unable to understand why the app is 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!

Joern Boegeholz
  • 533
  • 1
  • 8
  • 25
hs7624
  • 693
  • 2
  • 10
  • 20
  • 2
    I'm not an IOS developer but I can think of one think that may cause this problem. Maybe your app is leaking memory and after a curtain time it leaks so much memory that causes your app to crash. You can check your app for memory leaks. – Esat IBIS Jul 11 '16 at 12:50
  • when the app starts not working anymore, what do you do on your physical device? Do you try to kill the app and then restart the app? Do you try to kill the app, then restart the device and finally restart the app? Did you do these tests? – ddb Jul 11 '16 at 12:52
  • @Esat IBIS Can you please tell me how do I check the app for memory leaks? Can I do it using physical device? – hs7624 Jul 11 '16 at 13:00
  • @Komal I don't really know how to test in IOS, but I'm sure there will be libraries out there to do this job for you. If you google "How to check memory leaks in IOS" you'll get many results. – Esat IBIS Jul 11 '16 at 13:02
  • 1
    I have experienced similar issues , app installed via Xcode crashes on launch after few days – Bhumit Mehta Jul 11 '16 at 13:03
  • @ddb When the app doesnot work, I tried 1) restaring the app 2) Restarting the Iphone and opening the app. I coud not find an option to kill the app. – hs7624 Jul 11 '16 at 13:03
  • @Komal, if you make a double-tap on the home button, you will see a carousel of all apps running. Swype your app up and it will be killed – ddb Jul 11 '16 at 13:05
  • @Bhumit Mehta Could you find a solution? Can you please guide me in some direction? – hs7624 Jul 11 '16 at 13:06
  • 1
    i have the exact same issue, however when you instal your app via installr or submit and download it from the store it never crash after several days. so definitly not a memory leak – Mohamad Bachir Sidani Jul 11 '16 at 13:07
  • 2
    Plug the iphone into your mac and use xcode to see the crash logs – matt_roo Jul 11 '16 at 13:08
  • @ddb Thanks for your response. I have tried that. The app still gives a blank screen and shuts down and does not work till i run it again using XCode. – hs7624 Jul 11 '16 at 13:08
  • @Komal I dont think there is anything to solve, it happens to all my apps , apps installed via Xcode stop to work after few days , ill post here if I find some apple doc confirming this. – Bhumit Mehta Jul 11 '16 at 13:08
  • @Komal, which version of Xcode are you using? really your app has only 2 buttons and a so simple working mechanism? do you store something on your app? – ddb Jul 11 '16 at 13:09
  • Application '(null)' exited for an unknown reason. This is logged when app crash in device logs – Bhumit Mehta Jul 11 '16 at 13:20
  • @BhumitMehta Please check below answer. if you have not signed for apple developer program.. – Ketan P Jul 11 '16 at 13:21
  • @Komal Please check below answer. if you have not signed for apple developer program. – Ketan P Jul 11 '16 at 13:23
  • @ddb I am using XCode 7. Yes my app has only 2 buttons, one opens a url in safari and other opens a pop up message. – hs7624 Jul 11 '16 at 14:13
  • @EsatIBIS Thinking aloud, if it could be a memory leak, shoud'nt the app work after restarting th IPhone? – hs7624 Jul 11 '16 at 14:15
  • @Komal Yeah, you're right about that after reboot it should work. If it's not working after reboot, problem may have been caused by something else. – Esat IBIS Jul 11 '16 at 14:30
  • @Komal you can tick my answer. It will help other SO user to solve same kind of issue... – Ketan P Sep 20 '16 at 07:04
  • Just to confirm that this question and the answers below are valid for iPad as well, not only iPhone. – Hector Llorens Jul 05 '18 at 19:16
  • 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 – softmarshmallow Jul 14 '20 at 11:42

3 Answers3

58

If application is installed with Xcode and you don't have a Paid Program Developer Account, the life expectancy of the app is approximately 48 hours (There is no official time of validity for this).

For a paid program, it's a few months with the correct certificate. With TestFlight, it's now 60 days.

Indeed, if you don't sign your app, it has low life expectancy. It's quite new that Apple allows installation to devices for free accounts, but it's just for testing purposes (other than simulator), if you want more days to test on a device, you have to pay for the developer program.

Greg
  • 9,068
  • 6
  • 49
  • 91
Ketan P
  • 4,259
  • 3
  • 30
  • 36
  • 2
    I agree with this , have not seen anything official but it has been observation that apps dont open after a day or two. I use unpaid account – Bhumit Mehta Jul 11 '16 at 13:23
  • @BhumitMehta I will post in this thread if I find any official link from apple. – Ketan P Jul 11 '16 at 13:24
  • @Ketan P, Bhumit Mehta, Bashir Sidani : Thanks for replying. This is the first time I am developing IPhone app. Do you experience this issue with all apps you create or only few of them? – hs7624 Jul 11 '16 at 14:19
  • 1
    @Komal If it helps you then you can tick it as answer. TIA – Ketan P Jul 11 '16 at 15:00
  • @KetanP Do you have a source for this information. If you do, please share a reference. – n00bProgrammer Jul 11 '16 at 15:38
  • @n00bProgrammer I ll share once I found any reference regarding the same. – Ketan P Jul 12 '16 at 06:30
  • Same thing happened with 2 ionic apps I am coding, but they lasted around 4 or 5 days. – Joao Costa May 18 '17 at 10:48
  • 1
    According to [this answer](https://forums.developer.apple.com/thread/51527#thread-message-157434) in an Apple Forum thread, the Provisioning Profile expires exactly one week (7 days) after the app is installed. – Caleb Kleveter Feb 01 '18 at 14:49
51

No it's not a guess actually...

It's 7 days exactly for a free developer account.

You can check validity also in Xcode Provisioning profile also:

In General → Signing ("Automatically Manage Signing" checked) → Provisioning Profile (Click on Info (i) icon) you can check validity of the profile:

screenshot following the above instructions

Greg
  • 9,068
  • 6
  • 49
  • 91
dev_m
  • 796
  • 6
  • 12
  • thanks. I couldn't see the expiry days but now thanks to you. – Amare Apr 10 '18 at 11:27
  • 4
    To clarify a minor point which was a source of some personal confusion: It's 7 days *from the creation of the provisioning certificate*, and *not* 7 days from the time your app was built. So if, say, Monday at 12:00am Xcode renews your provisioning certificate (which it does automatically), and then Sunday evening that same week, you install your app onto a phone, that app will be functional for a few hours, until Monday 12:00am comes around. – pseudosudo Nov 21 '18 at 15:50
2

This forum helped me find an answer for a very similar issue I was facing with an Ionic iOS app I have running on a few iPads for a checkin kiosk at a non-profit I am developing for. For my scenario I just need the apps to run locally on WiFi and never on any other devices, never to be downloaded as a distributed app to the public. My apps kept randomly crashing on launch, and I would re-install the app from Xcode and they would start working again.

So my only real solution was creating an "Ad-Hoc" certificate and provisioning profile, where you can add up to 100 iOS devices to the provision. I had to manually add my 3 iPads to the provisioning profile, then download the file and open it, then in Xcode un-check "Automatically manage signing", then go below to "Provisioning Profile", then select your new ad-hoc style profile. And you should be good as long as your Apple developer account is in good standing (I believe, someone correct me if I'm wrong).

Just a heads up, first you personally have to be a paid and registered developer with Apple, not just added to a team by invite. I was invited in by another team for a completely different project and was not able to get set up and create the certificate and provisioning file on my own because of that. I had to leave my team, then register anew with Apple as an individual developer, then I could complete my steps.

  1. Your Apple developer account
  2. Create a Production Ad-Hoc Distribution Certificate
  3. Create an Ad-Hoc Provisioning Profile
  4. Managing Devises and Provisioning Profiles
Shane McCurdy
  • 2,203
  • 1
  • 10
  • 11