How to fix “Android N requires the IDE to be running with Java 1.8 or later” on Mac?


I get this error while I was in layout editor selecting api N for preview, It was so easy to fix,

  1. install jdk1.8
  2. Set “JDK_HOME” and “JAVA_HOME” environment variables.
  3. Edit the file “/Applications/Android"
  4. Look for “JVMVersion”
  5. add “1.8*,1.8+” to it:

Now restart your “Android Studio”

How to enable the three-finger drag gesture in OS X El Capitan


Step 1: Open System Preferences

Step 2: Click Accessibility

Step 3: Click Mouse & Trackpad

Step 4: Click Trackpad Options…

Step 5: Click Enable dragging

Step 6: Select “three finger drag” in the drop down box

Not only does the three finger drag gesture allow you to move around windows and other desktop items, it also allows you to select text.

Why Enter key on Mac OS X renames files instead of launching?


Enter has been the command to enter rename mode for a long time. At least since System 7 in 1993.

That bothered me, too, when I switched to Mac, but after some years of use and renaming lots of files in Finder, I appreciate it over pressing F2.

You can also open any file in the Finder by pressing cmd-down (the apple key + the down arrow). It also works for folders, too. This is intuitive if you think about it this way: cmd-up navigates up one level in the hierarchy of your filesystem and cmd-down navigates deeper. If it’s a file, going deeper opens the file.

How to Show hidden files on Mac OS X?


Unlike Microsoft Windows, by default OS X hides system files from end users. There is a perfectly reasonable explanation for this. Some of the files which are hidden, are important and damaging them could prevent your system from booting all together.

To do this all you need to do is:

  1. Open Finder
  2. Open the Utilities folder
  3. Open a terminal window
  4. Copy and paste the following line in:
    SUDO defaults write AppleShowAllFiles YES; killall Finder
  5. Press return
  6. Enter your administrator password when prompted
  7. Press return

You should find the finder window will disappear, along with the icons on your desktop. However, if you now launch a new finder instance you will now be able to see any hidden files or folders. Once you are done, perform the steps above however, replace the terminal command in step 4 with:

SUDO defaults write AppleShowAllFiles NO; killall Finder

If the above is not working for you, you may want to try switching YES/NO to TRUE/FALSE .. Beware that this is case-sensitive!

defaults write AppleShowAllFiles TRUE

If you are experiencing issues using the examples above, please post a comment using the comments system below.

How to add space between Mac OS X dock icons


Open Terminal and copy and paste this command:

defaults write persistent-apps -array-add '{tile-data={}; tile-type="spacer-tile";}'

and then restart dock:

killall Dock

The dock will refresh with an added space that can be dragged to any position (or removed by dragging it off the dock). Repeat the commands to add more spacer.

How to add Android adb path to Mac OS X


You can setup your Mac OS X terminal to run adb anywhere:

echo 'export PATH=$PATH:/Users/Mohsen/android-sdk/sdk/platform-tools/' >> ~/.bash_profile

If you put the android-sdks folder in another directory, replace the path with the directory android-sdks/platform-tools is in.

Restart your terminal…

How to Resolve a “Partition Failed” Error in Mac OS X


If you have attempted to partition a drive from Mac OS X and received a “Partition failed” message with the error “Couldn’t modify partition map because file system verification failed.” you can fix the problem with the file system check command line utility. To do this properly, you’ll need to boot into Single User Mode as well:

  1. Reboot the Mac into Single User Mode by holding Command+S during boot
  2. At the command prompt, type:
  3. /sbin/fsck -fy
  4. When fsck is complete, type “exit” or “reboot” to reboot
  5. Boot the Mac as usual, verify the disk again in Disk Utility, and partition as usual

Boot the Mac as usual and relaunch Disk Utility to verify the disk. Go ahead and partition the drive as usual, this time without any such error message.