EzDevInfo.com

osx interview questions

Top osx frequently asked interview questions

Where is JAVA_HOME on OSX Yosemite (10.10), Mavericks (10.9), Mountain Lion (10.8) or OSX Lion (10.7)?

Java is an optional package on the latest versions of OSX.

Yet once installed it appears like the JAVA_HOME environment variable is not set properly.


Source: (StackOverflow)

Maven Install on Mac OS X

I am new to Mac OS X and I am trying to install maven on it through the terminal by following these instructions.

So far I got this

export M2_HOME=/user/apple/apache-maven-3.0.3
export M2=$M2_HOME/bin
export PATH=$M2:$PATH
export JAVA_HOME=/usr/java/jdk1.6.0_22

This is probably a stupid question where do you go to find this?


Source: (StackOverflow)

Advertisements

Is there any way in the OS X Terminal to move the cursor word by word? [closed]

I know the combination Ctrl+A to jump to the beginning of the current command, and Ctrl+E to jump to the end.

But is there any way to jump word by word, like Alt+/ in Cocoa applications does?


Source: (StackOverflow)

Who is listening on a given TCP port on Mac OS X?

On Linux, I can use netstat -pntl | grep $PORT or fuser -n tcp $PORT to find out which process (PID) is listening on the specified TCP port. How do I get the same information on Mac OS X?


Source: (StackOverflow)

Do Swift-based applications work on OS X 10.9/iOS 7 and lower?

Will Swift-based applications work on OS X 10.9 (Mavericks)/iOS 7 and lower?

For example, I have a machine running OS X 10.8 (Mountain Lion), and I am wondering if an application I write in Swift will run on it.


Source: (StackOverflow)

Find (and kill) process locking port 3000 on Mac

How do I find processes that listens to/uses my tcp ports? I'm on mac os x.

Sometimes, after a crash or some bug, my rails app is locking port 3000. I can't find it using ps -ef... How do I find the stupid thing and kill it, brutally... ?

When doing rails server I get

Address already in use - bind(2) (Errno::EADDRINUSE)

2014 update:

To complete some of the answers below: After executing the kill commands, deleting the pid file might be necessary rm ~/mypath/myrailsapp/tmp/pids/server.pid


Source: (StackOverflow)

OS X Terminal Colors [closed]

I'm new to OS X, having just gotten a Mac after working with Ubuntu Linux for some time. Among the many things I'm trying to figure out is the absence of colors in my terminal window - like the ones that are shown (on Linux) when you run 'ls -la' or 'git status'... I just can't figure out how to activate them in the actual shell.


Source: (StackOverflow)

Xcode 4.4 and later install Command Line Tools

How do I get the command line builds tools installed with Xcode 4.4 / Mac OS X v10.8 (Mountain Lion) or later?

Unlike Xcode 4.3 there is no installer (it's just a bundle).

It looks like all the command line tools are there (in the bundle, under Contents/Developer), but none of the appropriate environment variables set to use them.

Is there a script somewhere I can run that will setup my environment to support building from the command line?


Source: (StackOverflow)

How can I develop for iPhone using a Windows development machine?

Is there any way to tinker with the iPhone SDK on a Windows machine? Are there plans for an iPhone SDK version for Windows?

The only other way I can think of doing this is to run a Mac VM image on a VMWare server running on Windows, although I'm not too sure how legal this is.


Source: (StackOverflow)

What should I set JAVA_HOME to on OSX

Many Java applications that use shell scripts to configure their environment use the JAVA_HOME environment variable to start the correct version of Java, locate JRE JARs, and so on.

On OSX 10.6, the following paths seem to be valid for this variable

/Library/Java/Home
/System/Library/Frameworks/JavaVM.framework/Home
/System/Library/Frameworks/JavaVM.framework/Versions/Current

Some of these are symlinks to the actual current VM (as defined in the Java Preference pane).

But which one should be used—or is it okay to use any of them?


Source: (StackOverflow)

Get the length of a String

How do you get the length of a String? For example I have a variable defined like:

var test1: String = "Scott"

However I can't seem to find a length method on the string.


Source: (StackOverflow)

What does this mean? "'NSUnknownKeyException', reason: ... This class is not key value coding-compliant for the key X"

I'm trying to link a UILabel with an IBOutlet created in my class.

My application is crashing with the following error. What does this mean? How can I fix it?

*** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<UIViewController 0x6e36ae0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key XXX.'


Source: (StackOverflow)

How can I Remove .DS_Store files from a Git repository?

How can I remove those annoying Mac OS X .DS_Store files from a Git repository?


Source: (StackOverflow)

Installing pip on Mac OS X

I spent most of the day yesterday searching for a clear answer for installing pip. I can't find a good solution.

Can somebody help me install it?


Source: (StackOverflow)

Setting environment variables in OS X?

What is the proper way to modify environment variables like PATH in OSX? I've looked on Google a little bit and found 3 different files to edit:

  • /etc/paths
  • ~/.profile
  • ~/.tcshrc

I don't even have some of these files, and I'm pretty sure that .tcshrc is wrong, since OSX uses bash now. Anybody have any idea where these variables, especially PATH, are defined?

Edit: I'm running OS X 10.5


Source: (StackOverflow)