I have an shell script file which is wrapped up in Mac's .app package. When I run the .app file the app crashes or sometimes doesn't show the UI. This is a Java swing application. When I run the same script file from the same current directory it runs fine.
So my .app contents are like below
build
->sample.app
-->Contents
-->MacOS
-->sample-mac.sh
On the terminal from build directory if I do
open sample.app
it crashes
if I do
sh -x sample.app/Contents/MacOS/sample-mac.sh
it runs perfectly
Can you tell me what are the differences in running the app file and underlying script file?