Pages

Showing posts with label macOSX. Show all posts
Showing posts with label macOSX. Show all posts

Thursday, November 23, 2017

cordova run android Error: spawn EACCES (MacOS)

When executing "cordova run android", I got error message: "Error: spawn EACCES". By using --verbose:
$ cordova run android --verbose ... Running command: "/Applications/Android Studio.app/Contents/gradle/gradle-4.1/bin/gradle" -p /Users/myuserid/cordova/myApp/platforms/android wrapper -b /Users/myuserid/cordova/myApp/platforms/android/wrapper.gradle Error: spawn EACCES

When I checked the access permission of /Applications/Android Studio.app/Contents/gradle/gradle-4.1/bin/gradle, I found that there is no execute permission. The solution for the error is just by modifying the access permission:
$ sudo chmod +x /Applications/Android Studio.app/Contents/gradle/gradle-4.1/bin/gradle

That's all :)

Friday, December 19, 2014

Android Studio was unable to find a valid JVM

I obtained the following message when opening Android Studio 1.0.1 on Mac OSX Yosemite:
Android Studio was unable to find a valid JVM
Among some workarounds for the problem that I found in this Stackoverflow thread, I think the simplest one is by creating a small bash script that export the environment variable for the JVM and launch the Android Studio. For example, in my machine the JVM is located at /Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk, so the script looks like this:
#!/bin/bash export STUDIO_JDK=/Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk open /Applications/Android\ Studio.app


That's all :)

Monday, July 01, 2013

How to have a similar mouse acceleration on Mac OSX with Windows

Have you ever noticed that the movement of mouse pointer on Mac OSX is somewhat different from that of on Windows?

Before I started using Mac OSX around 3 years ago, I have been a heavy user of Windows and Linux for years. Probably this is just my personal preference, but I feel that the acceleration of mouse movement on Mac OSX is not as comfortable as on Windows. I have been looking for the solution to get the same acceleration "feel" ever since but found nothing comparable to Windows. I have tried several software that can control mouse acceleration on Mac OSX, but still not satisfied. Even there are lengthy discussion on Apple forum debating this matter.

Gladly, there are wonderful engineers that started to develop the promising solution: http://smoothmouse.com/

If anyone feel uncomfortable with the acceleration of mouse on Mac OSX, I would suggest to try this software. It surpasses any other softwares (includes the paid one) that I have tried to make my mouse movement on Mac OSX as similar as on Windows. I hope that Apple could notice this little yet important matter, especially for new users who were heavy users of Windows, and provide built-in solution on the next release of OSX. I could understand that not all users notice the difference. But It is somewhat a shame on Apple for not noticing this little matters for years.

That's all :)

Wednesday, February 27, 2013

Change screen resolution of Ubuntu 12.10 on Parallels 7

When I installed Ubuntu 12.10 using Parallel 7 and installed the Parallels Tools, it seems that the screen resolution is fixed to 800 x 600 pixels only. Gladly that there is a workaround for this problem. It is by using the Parallels Tools from Parallels 8. Credit to the post here: http://forum.parallels.com/showpost.php?p=657046&postcount=53 The steps are as follows:
  1. Download the trial version of Parallels 8.
  2. Mount the dmg file of Parallels 8.
  3. Open terminal, go to the mounted dmg, for example in my system I did like this:
    $ cd /Volumes/Parallels\ Desktop\ 8/
  4. Copy the iso file of the Parallel Tools to my home directory (or any directory), example:
    $ cp ./Parallels\ Desktop.app/Contents/Resources/Tools/prl-tools-lin.iso ~/
  5. Mount the iso from the Ubuntu 12.10, and upgrade the Parallels Tools from Ubuntu 12.10 terminal, example:
    $ cd /media/{your-Ubuntu-user}/Parallels\ Tools $ sudo ./install
That's all :)

Thursday, July 26, 2012

OSX Mountain Lion workaround to enable web sharing

I have just upgraded to Mountain Lion. But I feel very disappointed that the web sharing feature is missing. I cannot access my local site, but somehow I still can get the default apache page when accessing http://localhost/.

Here is the workaround that I did to re-enable my own site. To make it safe, make sure to make a copy of /etc/apache2/httpd.conf before modifying anything.

(1) Open terminal, switch to root:
$ sudo su -
(2) Go to /etc/apache2/users/:
$ cd /etc/apache2/users $ ls
(3) I found one file Guest.conf. I copy the file into another file (in this case I am using my own user name: chn.conf), and edit the directory location to my Site location in "/Users/chn/Sites":
$ cp Guest.conf chn.conf $ vi chn.conf
It looks like this after the modification:
<Directory "/Users/chn/Sites/">
    Options Indexes MultiViews
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>
(4) Let apache load PHP module, by editing the httpd.conf:
$ vi /etc/apache2/httpd.conf
Search for the following line:
#LoadModule php5_module libexec/apache2/libphp5.so
and remove the remark "#" in the beginning of the line so it looks like this:
LoadModule php5_module libexec/apache2/libphp5.so
(5) Restart the apache service by the following command:
$ apachectl restart
Now I can access my own homepage again.

That's all :)

Monday, July 16, 2012

How to do screen capture in MacOSX in JPG instead of PNG

In MacOSX, we can easily do screen capture and save the image in PNG format to the desktop by the following keyboard shortcuts:
  • Comand+Shift+3 : capture the whole screen.
  • Comand+Shift+4 : capture a particular area by specifying the area using mouse, or by pressing spacebar to select a window.
Nevertheless, we may want to save the screen capture file in a different file format, such as JPG or maybe PDF. To do so, apply the following command in the terminal (the example is using JPG format):
$ default write com.apple.screencapture type jpg $ killall SystemUIServer

That's all :)

Monday, February 28, 2011

How to hibernate instead of standby when closing the lid of macbook(pro|air)

Sometimes, we probably prefer to hibernate my mbp instead of make it standby when closing the lid. I am wondering why there is no GUI setting for this simple matter. The only way that I know is by using command pmset from the terminal window as follow:

(1) To enable the hibernate:
$ sudo pmset -a hibernatemode 5

(2) To switch back (standby):
$ sudo pmset -a hibernatemode 0

Or for more detail of pmset command, read the manual (man pmset).

That's all :)

Saturday, February 26, 2011

How to show full path in Mac OSX Finder window title bar

To show the complete path in the Finder title bar of Mac OSX (maybe only for OSX 10.5 and newer), type the following two commands in terminal:

$ defaults write com.apple.finder _FXShowPosixPathInTitle -bool YES
$ killall Finder

And to reverse:

$ defaults write com.apple.finder _FXShowPosixPathInTitle -bool NO
$ killall Finder

That's all :)

Friday, January 14, 2011

How to add shortcut to sidebar OSX

To add shortcut to the finder's sidebar on OSX:
  1. drag and drop the folder or,
  2. select the folder, press: Command+T

That's all :)

Tuesday, June 29, 2010

Colored ls in MacOSX terminal

To have a colored ls in MacOSX terminal:
  1. edit or create ~/.profile
  2. add line:
    export CLICOLOR=1

That's all :)