Showing posts with label Mac. Show all posts
Showing posts with label Mac. Show all posts

How to take simulator screenshots for Android is a frequently asked question. There are many ways to do it, but I'd like to show you the easiest and quickest way for Windows and OS X.

I assume here, that you have already installed the Android SDK. If not, you can install it from https://developer.android.com/sdk/index.html

Ok, now just start your simulator as usual. After your simulator is already up and running, go to the Android SDK folder/tools and start the monitor tool (or just search for monitor in the SDK folder).

In the Monitor tool, when you look at the toolbar you have a screenshot icon there. Click and voila, there you are!


You've experienced unusual problems trying to share your screen on a MacBook Pro with Retina display? A black screen with a moving mouse cursor is shared?

In this case your current display resolution settings are too high for screen sharing.

To change the resolution of your display, you can use a tool like "Display Menu".

https://itunes.apple.com/gb/app/display-menu/id549083868?mt=12&ls=1

After you changed the resolution, you may have to restart your screen sharing session.



Go to Terminal and open the bash_profile:
vi ~/.bash_profile
Press "i" to insert and copy the following line to the bash_profile script (Make sure that the path matches your XAMPP installation):
export PATH=/Applications/XAMPP/xamppfiles/bin:$PATH
Commit the current changes while pressing ESC and writing :wq + ENTER 

To apply your changes to the current Terminal session, type:
source ~/.bash_profile
or just close and open the Terminal again.


You have an iPhone storyboard and want to support the iPad too? This can be done in a quick way:

  1. Open Xcode
  2. Duplicate the existing storyboard.
  3. Rename them to "MainStoryboard_iPhone.storyboard" and "MainStoryboard_iPad.storyboard"
  4. Right click on the "MainStoryboard_iPad.storyboard" file > "Open as" > "Source code" 
  5. Search & Replace:
    targetRuntime="iOS.CocoaTouch"
    with:
    targetRuntime="iOS.CocoaTouch.iPad"
  6. Done!

AJAX-Requests for local files are not working on Google Chrome.
XMLHttpRequest cannot load file:///Users/… . Origin null is not allowed by Access-Control-Allow-Origin
To bypass, either use a HTTP server or start Google Chrome with a command-line switch. Open the Terminal and type the command below:
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --allow-file-access-from-files
If you receive a message like:
XMLHttpRequest cannot load ... Cross origin requests are only supported for HTTP.
Open the Terminal and type the command below:
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --disable-web-security

As long as web security is disabled, it is not recommended to surf on public internet pages. In this mode your web browser is vulnerable for any kind of cross-site scripting.

For more information about Google Chrome command-line switches, take a look at Google Chrome command line switches.


Today I had a small problem - how to make hidden files and folders visible in Finder?

After some researches on the web, I found the following solution:

Open the Terminal and run the following command:
defaults write com.apple.finder AppleShowAllFiles TRUE
Before the changes will take effect, you need to restart Finder by running the following command:
killall Finder
Done!

To hide hidden files invisible again, open a Terminal and run the following command:
defaults write com.apple.finder AppleShowAllFiles FALSE
killall Finder


You want to use Time Machine over WIFI? - Then you have to buy a Time Capsule or you run a Time Machine at Ubuntu.

Tested with iOS 10.8.2 and Ubuntu Server 12.04

You did an unsuccessful installation before?

For the case that you did, remove Netatalk and all configuration files:
sudo apt-get remove --purge netatalk

Preparing the Ubuntu server...

From the Terminal (press + SPACE and type terminal) you have to run the following command to install Netatalk:
sudo apt-get install netatalk
Note: See also Netatalk HTML documentation for more details.
Configure the afpd server:
sudo vi /etc/netatalk/afpd.conf
Add the following line at the end of this file:
- -tcp -noddp -uamlist uams_dhx.so,uams_dhx2_passwd.so -nosavepassword
Check if CNID_METAD_RUN=yes in "/etc/default/netatalk" file. Otherwise change it. Create a new user for the Time Machine connect:
sudo adduser username
Go to the newly created user directory and create a backup folder there:
cd /home/username/
mkdir time_backup
sudo chown -R username:username time_backup
Configure the newly created backup directory in Netatalk:
sudo vi /etc/netatalk/AppleVolumes.default
At the end of the file you add the following entry:
/home/username/time_backup "My Time Machine Backup" allow:username cnidscheme:dbd volsizelimit:250000 options:usedots,upriv,tm
Make sure that you adjust the directory and username to your needs. With "volsizelimit" you can define the maximum size of the backup. In this case 250 GB.

After you are finished with all the configuration staff you need to restart the Netatalk service:
sudo service netatalk restart
Don't forget to allow afp if you are using ufw - Uncomplicated Firewall:
# Allow network access to the ports 548 and 427
sudo ufw allow 548
sudo ufw allow 427
sudo ufw disable && sudo ufw enable 

Preparing the Mac client...

To allow unsupported network volumes, you have to run the following command in Terminal (press + SPACE and type terminal):
defaults write com.apple.systempreferences TMShowUnsupportedNetworkVolumes 1
"Connect to your server" (open Finder and press + K) and type the address of your server:
afp://ip_address
Congrats, your Ubuntu server volume should be visible and ready for Time Machine usage now.


Well, there are many ways to access a Mac via remote desktop... I'll explain a very simple way here.

On your Mac, go to Settings -> Sharing -> Screen Sharing and enable the VNC option + a password. Make sure that you have enabled the Screen Sharing itself too.

That's it! Your Mac is ready for a VNC connection now.

If you want to connect to your Mac from another computer, you can use a client like http://www.realvnc.com/.


To enable the inspector you need to type the following in Terminal (press + SPACE and type terminal) once:
defaults write com.apple.Safari IncludeDebugMenu 1
Restart safari... You will now see the "Inspect Element" item in safari contextual menu.


Adding new directories to path variable is really simple under Mac OS X. Just follow the next few steps:
  1. Open the Terminal (press + SPACE and type terminal).
  2. Make sure that you are in your home directory
  3. Type:
    echo 'export PATH=YOURDIRECTORY:$PATH' >> ~/.profil
    • Don't forget to replace "YOURDIRECTORY" with your directory string. In example: /opt/local/bin
  4. Re-open the terminal.
The directory you added should be available in the path variable now.