HexCon is coming to NYC. Catch the early-bird price before the time's up! Book me a spot

Scripts to manage apps in macSolved

Participant
Discussion
3 years ago

I’d like to perform some app management functions using scripts for my mac devices. Specifically, I’d want to open an app in the device and also close an application using scripts. Are these possible with scripts? If the end user has force closed one of our enterprise applications, I want to open them forcefully to ensure smooth functioning of the company.

Replies (3)

Marked SolutionPending Review
Participant
3 years ago
Marked SolutionPending Review

Any command that can be executed from the terminal can be pushed via Custom Scripts as well.

Marked SolutionPending Review
Participant
3 years ago
Marked SolutionPending Review

I did try out some scripts but it wasn’t working properly in my devices. Can someone comment if they know any script to perform the above-mentioned app management functions? I’d like to get a script for uninstalling an application as well to get rid of the applications that are no longer required in certain devices.

Marked SolutionPending Review
Hexnode Expert
3 years ago
Marked SolutionPending Review

Hey Arden,

Thank you for reaching out to us!

Hexnode UEM lets you execute custom scripts on macOS devices running on macOS 10.11 and above. We have a set of bash scripts that have been tested and verified to perform the app management functions that you have requested:

  • Open an application: You can open an application using the following methods:
    1. App name: open –a “app_name”
    2. Bundle ID: open –b bundle_id
  • Uninstall an application: sudo rm -rf “/path to the app”
  • Force-close an application: killall “appname”

You can also check out Hexnode’s sample script repository for macOS devices which includes a wide range of verified scripts. If you have further queries, please do reach out to us again.

Hope this clears your query.

Cheers!
Chris Coleman
Hexnode UEM