iPhone app under test crashes after a few days

17,254

Solution 1

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.

Solution 2

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

Solution 3

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
Share:
17,254

Related videos on Youtube

hs7624
Author by

hs7624

Updated on June 27, 2022

Comments

  • hs7624
    hs7624 almost 2 years

    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!

    • Esat IBIS
      Esat IBIS almost 8 years
      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.
    • ddb
      ddb almost 8 years
      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?
    • hs7624
      hs7624 almost 8 years
      @Esat IBIS Can you please tell me how do I check the app for memory leaks? Can I do it using physical device?
    • Esat IBIS
      Esat IBIS almost 8 years
      @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.
    • Bhumit Mehta
      Bhumit Mehta almost 8 years
      I have experienced similar issues , app installed via Xcode crashes on launch after few days
    • hs7624
      hs7624 almost 8 years
      @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.
    • ddb
      ddb almost 8 years
      @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
    • hs7624
      hs7624 almost 8 years
      @Bhumit Mehta Could you find a solution? Can you please guide me in some direction?
    • Mohammad Bashir Sidani
      Mohammad Bashir Sidani almost 8 years
      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
    • matt_roo
      matt_roo almost 8 years
      Plug the iphone into your mac and use xcode to see the crash logs
    • hs7624
      hs7624 almost 8 years
      @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.
    • Bhumit Mehta
      Bhumit Mehta almost 8 years
      @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.
    • ddb
      ddb almost 8 years
      @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?
    • Bhumit Mehta
      Bhumit Mehta almost 8 years
      Application '(null)' exited for an unknown reason. This is logged when app crash in device logs
    • Ketan P
      Ketan P almost 8 years
      @BhumitMehta Please check below answer. if you have not signed for apple developer program..
    • Ketan P
      Ketan P almost 8 years
      @Komal Please check below answer. if you have not signed for apple developer program.
    • hs7624
      hs7624 almost 8 years
      @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
      hs7624 almost 8 years
      @EsatIBIS Thinking aloud, if it could be a memory leak, shoud'nt the app work after restarting th IPhone?
    • Esat IBIS
      Esat IBIS almost 8 years
      @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.
    • Ketan P
      Ketan P over 7 years
      @Komal you can tick my answer. It will help other SO user to solve same kind of issue...
    • Hector Llorens
      Hector Llorens almost 6 years
      Just to confirm that this question and the answers below are valid for iPad as well, not only iPhone.
    • softmarshmallow
      softmarshmallow almost 4 years
      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
  • Bhumit Mehta
    Bhumit Mehta almost 8 years
    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
  • Ketan P
    Ketan P almost 8 years
    @BhumitMehta I will post in this thread if I find any official link from apple.
  • hs7624
    hs7624 almost 8 years
    @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?
  • Ketan P
    Ketan P almost 8 years
    @Komal If it helps you then you can tick it as answer. TIA
  • n00bProgrammer
    n00bProgrammer almost 8 years
    @KetanP Do you have a source for this information. If you do, please share a reference.
  • Ketan P
    Ketan P almost 8 years
    @n00bProgrammer I ll share once I found any reference regarding the same.
  • Joao Costa
    Joao Costa almost 7 years
    Same thing happened with 2 ionic apps I am coding, but they lasted around 4 or 5 days.
  • Caleb Kleveter
    Caleb Kleveter over 6 years
    According to this answer in an Apple Forum thread, the Provisioning Profile expires exactly one week (7 days) after the app is installed.
  • Amare
    Amare about 6 years
    thanks. I couldn't see the expiry days but now thanks to you.
  • pseudosudo
    pseudosudo over 5 years
    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.