Install Top

From AwkwardTV
Jump to: navigation, search

Quick guide to building (the binary is linked at the bottom of the page) the Top command line application on the Apple TV, originally posted by jMahn on the AwkTV forums, its come up a couple of times since so I figured put it in the main how-to section, if anybody has any other info or edits to this of course feel free, I've never posted on a wiki before - DaiMac79

(Original post is here) The version of the "top" command from OSX doesn't run on Apple TV (at least not the 10.4.9 version from my MacBook).

I was able to download the source for the Darwin version from Apple and it works just fine. Basic instructions...

  1. Get source here: . Scroll down to: top-17.4
  2. Download source. You'll need to have registered as an Apple developer (remember, it's free).
  3. Unpack, then in Terminal, CD into the folder it unpacked.
  4. If you are compiling on a Mac running 10.5 or 10.6 then you will need to tell the compiler to compile a 10.4 compatible version of top. Type "pico Makefile" and add the following to the end of the CFLAGS line: -mmacosx-version-min=10.4
  5. Save the file (Ctrl-x) and then type "make"
  6. There will be an error at the end because by default, the Makefile tries to install the newly built "top", but you didn't run it with "sudo". That's okay, you don't actually want to install it on your Mac.
  7. Copy the new version to your AppleTV, either with scp or drag and drop if you've got its drive mounted.
  8. You can run top by typing ./top in the folder where you have copied it otherwise you can replace the the non-functional version on the Apple TV by copying it to the /usr/bin folder. You will need to set the file system as read/write before doing this.
  9. You need to give it special permissions since it does system stuff:
sudo chown root:wheel /usr/bin/top
sudo chmod 4755 /usr/bin/top

Then, just type top ! (/usr/bin always in search path)