1

I need to start an app from another app with just one command on macOS. So, I can't use cd to get to the right path.

I just need to run the app with the full path like: /my/path/to/app/myapp -parameter1 1 -parameter2

Is this even possible on macOS? (I would like to avoid to install the app.) So cd and then execute is not possible because of: https://stackoverflow.com/questions/4884681/how-to-use-cd-command-using-java-runtime

  • Most apps do not install they are hust a bundle on the disk - so what do you mean by not install. How are you trying to start the second app? – user151019 Sep 20 '18 at 8:24
  • 1
    Welcome to AskDifferent! We love to help, but right now it's a bit unclear what the problem is. Can you add some details about what exactly you want to accomplish here, ideally with specific examples? What do you mean by "start an app from another app"?, what do mean by "don't want to install" (what is the difference between installed and not installed for you)? – nohillside Sep 20 '18 at 8:25
  • I'm using a java app and I want to execute the app through this java app.So I can't traverse to the path and then execute like ./myexecuteapp – user3776738 Sep 20 '18 at 8:27
  • Are both apps Java? – user151019 Sep 20 '18 at 8:55
  • Also the SO question you point has the solution in the accepted answer. – user151019 Sep 20 '18 at 9:01
0

Just at the dot at the beggining of the multilevel path : ./my/path/to/app/myapp Dot refers to the current dir. Or you can use absolute path from the root of your disk without the dot like /Users/Me/my/path/to/app/myapp Or if it is a jar file (you mentioned that it is Java app) you can start it as java -jar /my/path/to/app/myapp

0

Do you want the app to contine running after the Java app closes or not.

If you want it to close the use the other answer https://apple.stackexchange.com/a/336994/237

If you want it to continue then run the app using open e.g.Runtime.getRuntime().exec("open path_to_app/App.app. null)

If the thing you want to call is not a App (ie not an App bundle) then just use the path to the executable.

If both apps are both Java why not build them into one app - or use Java's runtime loading.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .