Launching application from command line

Deploying to Mac OS? Ask Mac OS specific questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
giovanni_c
Posts: 52
Joined: Sat Sep 08, 2012 10:50 am

Launching application from command line

Post by giovanni_c » Mon Mar 18, 2019 1:20 pm

Hi everybody,
I'm experiencing a lot of troubles in launching an application from command line as the behavior is not understandable.
My real need is to launch an application with admin privileges so my basic idea is (as it's also described in documentation) to have a bash script, to invoke with the "open elevated process", that launches my application.
My problem is that when the application is launched from the command line it seems that the basic library are not fully loaded. Here is attached a simple sample stack that at the openstack writes the milliseconds on a text file and put the content on the field. Then there is a button that calls the "openstack" handler and then launches an answer. If you try to launch the app from the command line (using the "open -a test.app" command) the application executes the openstack but when you click on the button it shows an answer without any buttons (also see attached screenshot).
I also tried to use the command line to launch the executable file inside the bundle with similar behavior.

You can also find attached the sample stack. If you create a mac standalone from it you can experience the problems that I highlighted.

Can someone helps me to understand what's goin'on and how I can be sure that the application called from the command line loads all the needed libraries?
Thank you very much for any help you will be able to give me!


Schermata 2019-03-18 alle 13.13.42.png
Schermata 2019-03-18 alle 13.13.42.png (4.02 KiB) Viewed 3090 times
Attachments
test.zip
(1.64 KiB) Downloaded 232 times

Post Reply

Return to “Mac OS”