Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am attempting to set the priority on an application to be higher, but I keep getting 'permission denied' when attempting to do som even as the superuser. From the Terminal: Alexandsteins-Macbook:~ alexanderstein$ sudo nice -n -10 /Applications/Minecraft.app nice: /Applications/Minecraft.app: Permission denied

share|improve this question

migrated from stackoverflow.com Apr 23 '13 at 8:17

This question came from our site for professional and enthusiast programmers.

1 Answer 1

up vote 1 down vote accepted

firstly, you need to nice the program that is launched. You're pointing at a directory. Applications on mac os are files within the application bundle.

The file you're looking for will be located within the directory:

/Applications/Minecraft.app/Contents/MacOS

I don’t have minecraft, so I don’t know what the file is called.

you can nice that file, which should have the desired effect.

You could use a little bit of applescript to accomplish something similar (it's not exactly the same):

tell application "Minecraft"
  activate
  delay 1
end tell

tell application "System Events" to set pid to unix id of process "Minecraft"
do shell script ("renice -10 -p " & pid) password "xxxxxxxxx" with administrator privileges

You can either replace the xxxxxxxxx with your password, or else omit the entire password "xxxxxxxxx", and have the UI prompt you for an administrator account to perform the task.

This will also work with running copies of minecraft.

To get the applescript to run, you can use the applescript editor to create a scriptlet, or put it into a simple text file, and run it using osascript textfile.

share|improve this answer
    
Ah, okay. So you have to point it to the actual binary fine, then? –  Alexandstein Apr 23 '13 at 7:51
1  
Yes, I'll add a little bit of applescript that can accomplish something similar –  Petesh Apr 23 '13 at 7:53

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.