iOS app works on device only when it is connected to the Xcode or CLI ,as soon as it is disconnected the app is stuck on splash screen

As long as the phone is connected to the pc , the apps works fine. As soon as it is disconnected and the app is re-run it is stuck on splash screen .

Also it shows blank screen with empty header in ionic view app.
Stuck on splash screen when not connected to pc

Have you tried debugging it using Safari Remote Debugging?

are you using $ ionic run ios -l ?

in case of live reload option, the config.xml creates the content src tag with the ipaddress of you computer so the webview will look for the index file on that ipaddress. When you remove the cable, the installed app will continue to refer to that ipaddress instead of the local.

Check this line in config.xml:

it should refer to index.html and not the ipaddress/index.html

The content has reference to index.html and not ipAddress/index.html.image

then you have some error in your code. Try debugging using safari.

But it works fine if the phone is connected to the computer.

Again, try using Safari Remote Debug feature.

Without looking at your code or access to your app, we cannot help you here. You need to see the safari console and debug your app.

When you stop ionic live reload, the config.xml is restored to original setting and hence, index.html is only shown. While still running the app, check config.xml for ipaddress/index.html. If it is there, it means that the app needs to be connected to the pc and run. if it is not there, it means that your code has the problem.

Either way safari debugger is your best friend.

It may sound very naive , but can I debug a device using Safari debugger without physically connecting it to the machine ?

Damn, my bad, I didn’t connect these two information together.

Tell me does your application requires an external resource on initialization?

yes , it does . Time being it’s Ionic logo which is supposed to be changed soon.

Have you included Cordova Whitelist plugin and security meta tag required for external connections?

Did that just now, no luck. Xcode console is :
2015-09-03 17:40:47.497 BirlaSchool[1932:579555] DiskCookieStorage changing policy from 2 to 0, cookie file: file:///private/var/mobile/Containers/Data/Application/0CF1A516-0566-446F-BD13-B43CCE2F7ACF/Library/Cookies/Cookies.binarycookies
2015-09-03 17:40:47.552 BirlaSchool[1932:579555] Apache Cordova native platform version 3.8.0 is starting.
2015-09-03 17:40:47.553 BirlaSchool[1932:579555] Multi-tasking -> Device: YES, App: YES
2015-09-03 17:40:47.564 BirlaSchool[1932:579555] Unlimited access to network resources
2015-09-03 17:40:47.665 BirlaSchool[1932:579555] [CDVTimer][keyboard] 0.178993ms
2015-09-03 17:40:47.858 BirlaSchool[1932:579555] [CDVTimer][splashscreen] 193.006992ms
2015-09-03 17:40:47.907 BirlaSchool[1932:579555] [CDVTimer][file] 48.169971ms
2015-09-03 17:40:47.907 BirlaSchool[1932:579555] [CDVTimer][TotalPluginStartup] 242.570996ms
2015-09-03 17:40:48.221 BirlaSchool[1932:579555] Resetting plugins due to page load.
2015-09-03 17:40:49.668 BirlaSchool[1932:579555] Failed to load webpage with error: Could not connect to the server.

This is part of index.html
image

The Applicttion has numerous http calls.

This is the Xcode log if I run the app on device ,after running an instance on simulator with command: ionic build ios && ionic emulate ios --livereload

2015-09-03 18:19:10.601 BirlaSchool[212:5194] DiskCookieStorage changing policy from 2 to 0, cookie file: file:///private/var/mobile/Containers/Data/Application/89C0158A-E0FB-4975-BC48-79F630C549B6/Library/Cookies/Cookies.binarycookies
2015-09-03 18:19:10.746 BirlaSchool[212:5194] Apache Cordova native platform version 3.8.0 is starting.

2015-09-03 18:19:10.747 BirlaSchool[212:5194] Multi-tasking -> Device: YES, App: YES
2015-09-03 18:19:10.751 BirlaSchool[212:5194] Unlimited access to network resources
2015-09-03 18:19:10.833 BirlaSchool[212:5194] [CDVTimer][keyboard] 0.160992ms
2015-09-03 18:19:10.945 BirlaSchool[212:5194] [CDVTimer][splashscreen] 111.706972ms
2015-09-03 18:19:10.977 BirlaSchool[212:5194] [CDVTimer][file] 32.242000ms
2015-09-03 18:19:10.978 BirlaSchool[212:5194] [CDVTimer][TotalPluginStartup] 145.222008ms
2015-09-03 18:19:11.156 BirlaSchool[212:5194] Resetting plugins due to page load.
2015-09-03 18:19:13.609 BirlaSchool[212:5194] Finished load of: http://192.168.2.105:8100/#/