'App closes automatically when not ran from Xcode
I am developing an app using react native.
When I test it on iOS device connected by USB (when I run from Xcode Integrated development environment). It works as expected. But if I unplug USB cable, the app is still on the phone, can be opened but only displays "NameofTheApp - Powered by React native" and shuts automatically after 10 seconds.
I have following questions
- Is it normal as it is only on development mode
- Is it a bug which i have to fix before releasing app?
Solution 1:[1]
This happened because when you run from the XCode, it has two modes. 1. Debug 2. Release
The crash happened because you were running in release while running xcode.
While running in Xcode, edit schema and set the mode as debug as follows:
Choose Product -> Scheme -> Edit Scheme. Change the Build Configuration under the Info tab to debug.
Solution 2:[2]
For me I had the 'debug executable' checkmark checked.
This is at Product -> Scheme -> Edit Scheme,
Select Run section on left side, info tab and verify that debug executable is Unchecked
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Amal T S |
| Solution 2 | aaronvargas |
