A summary of knowledge about Apple development

Source: Internet
Author: User
Tags exit in

Apple development also has a long time, intermittent about 4 years has been "not engaged in this industry", from the beginning of a training company in Beijing to learn the development of iOS, to find work, then lost work, lost confidence, and then back to the development. The process is complex. Today, we summarize some of the most commonly used Apple computer operation and development environment Xcode and the terminal's Common command of some operational knowledge.

  First, summarize the operation of the Apple system.

1.mac system shortcut key symbol . This is crucial because when we open a software, often the shortcut keys are used to represent the keys of the actual keyboard using the symbols in the figure below.

such as Xcode

If we don't understand the keys that these graphs represent, we can't use shortcut keys.

 

2. Basic shortcut keys

Command-z Revocation

Command-x Cut

Command-c Copy (copy)

Command-v paste

Command-a full selection (All)

Command-s Saving (Save)

Command-f Search (Find)

2. Shortcut keys

Command-shift-4 intercepts the selected screen area to a file

Command-shift-3 intercept all screens to file

Command-shift-control-3 intercept all screens to clipboard

Command-shift-4 intercepts the selected screen area to a file, or presses the SPACEBAR to capture only one window

Command-shift-control-4 intercepts the selected screen area to the Clipboard, or presses the SPACEBAR to capture only one window

3. Common Application shortcut keys

Command-option-esc to open the Force exit window

Command-h Hiding (hide) the currently running application window

Command-option-h hiding (hide) Other application windows

Command-q exit (quit) the front-most application

Command-shift-z redo, that is, reverse operation of undo

Command-tab in the Open Applications list to the next most recently used application, equivalent to Windows (ALT + TAB)

Command-option-esc Open the Force exit window and, if an application is unresponsive, select Force exit in the window list

  

4. Text Processing

Command-RIGHT ARROW moves the cursor to the end of the current line

Command-b Toggle the selected text bold display

Fn-delete is equivalent to delete on the PC full-size keyboard, which is deleted backwards

fn-up Arrows up one page (page UP)

fn-down arrow Scroll down one page (page down)

fn-LEFT ARROW Scroll to beginning of document (Home)

fn-RIGHT ARROW scroll to end of document (end)

Command-RIGHT ARROW moves the cursor to the end of the current line

Command-LEFT ARROW moves the cursor to the beginning of the current line

Command-down ARROW moves the cursor to the end of the document

Command-up ARROW moves the cursor to the beginning of the document

option-RIGHT ARROW moves the cursor to the end of the next word

Option-LEFT ARROW moves the cursor to the beginning of the previous word

Control-a move to the beginning of a line or paragraph

5.Finder

Command-option-v Cut Files

Command-shift-n Creating a new folder (new)

Command-shift-g window, can enter absolute path Direct folder (Go)

Return this is not really shortcut keys, click on the file, press to rename the file

Command-o Open the selected item. Open file in Mac not like Windows directly press ENTER

Command-option-v function is equivalent to file clipping in Windows. Copy the file (command-c) to a different location, press this shortcut at the destination and the file will be clipped to this location

Command-up Arrow opens the folder containing the current folder, which is equivalent to "up" in Windows

Command-delete moving files to the Trash

Command-shift-delete emptying the wastepaper basket

Spacebar to quickly view the selected file, which is the preview feature

6.Safari

Control-tab Turn to next tab page

Command-l cursor jumps directly to the address bar

Control-tab Turn to next tab page

Control-shift-tab Turn to previous tab page

command-Plus or equal sign Enlarge page

command-minus Zoom Page

Xcode shortcut keys

1.Xcode is primarily used to manipulate the display and hiding of Xcode, and some environment settings

Preferences are some of the environments used to set up Xcode, such as the color, size, and so on of the Code Editor text.

2.File for manipulating projects, creating new files, opening projects, and more

New

Comman+n Creating a file

3.Edit for editing files, rename class names, etc.

4.View Some of the windows used to display Xcode

5.Find to find and replace text in a project

6.Navigate Navigation

7.Editor

8.Product for running and debugging projects

9.Debug

10.Source Control

11.Window

12.Help

Terminal commands

How to enter command line operation mode

In the graphical interface, open the application with Finder-"utility-" terminal

Basic commands

List files

LS parameter directory name

Example: Want to see what is in the directory,

LS/

Want to see what's in the drive directory,

Ls/system/library/extensions

Parameter-W displays Chinese,-l details,-a including hidden files

 Converting catalogs

Cd

Example: Think of a drive directory to stroll around

Cd/system/library/extensions

 Create a new directory

mkdir Directory Name

Example: Create a backup directory in the driver directory

Mkdir/system/library/extensions/backup

Build a backup directory on the desktop back up

mkdir/user/User name/desktop/backup

Copy files

CP parameter source file destination file

Example: Want to copy the desktop Natit.kext to the drive directory

Cp-r/user/User Name/desktop/natit.kext/system/library/extensions

The parameter R indicates a recursive operation of the directory, and Kext looks like a file under the graphical interface, which is actually a folder.

Back up all files in the drive directory to desktop backup

Cp-r/system/library/extensions/*/user/User name/desktop/backup

  deleting files

RM parameter file (RM-RF folder)

Example: To delete a driver's cache

Rm-rf/system/library/extensions.kextcache

Rm-rf/system/library/extensions.mkext

Parameter-RF is recursive and mandatory, be careful to use, if executed RM-RF/your system is gone

 Moving files

MV File

Example: Want to move Applehda.kext to the desktop

mv/system/library/extensions/applehda.kext/user/User name/desktop

Want to move the Applehda.kext to the backup directory

Mv/system/library/extensions/applehda.kext/system/library/extensions/backup

 Change file permissions

chmod parameter permission file (#add ch represents change)

Example: Set all files in the drive directory to root read/write, other users read only

Chmod-r 755/system/library/extensions

The parameter R is recursive, and 755 represents the permissions of each user

 Change file Owner

Chown parameter User: Group file

Example: Change all the files in the drive directory to the root user

Chown-r root:wheel/system/library/extensions

Parameter r indicates a recursive operation

Fix permissions on files throughout the system

Diskutil repairpermissions/

Strictly speaking, this is not a Unix command, but OSX is a software that remembers the modification or addition of the driver to execute once.

  Text editing

Nano file name

Example: Edit Natit info.plist

Nano/system/library/extensions/natit.kext/info.plist

After editing, use Ctrl +o to save, ctrl+x exit

Another text editing software is VI, the operation is a bit odd, cooked is very useful, and in all Unix-like systems, it is not afraid to go all over the world.

 Run script command

SH Script file name

Example to modify the driver after all the required operations into a script, after the driver has been modified to run once this script is OK, convenient

1. Running Nano/clean in terminal

2. Paste the following code into the nano

Rm-rf/system/library/extensions.kextcache

Rm-rf/system/library/extensions.mkext

Chown-r root:wheel/system/library/extensions

Chmod-r 755/system/library/extensions

Diskutil repairpermissions/

Kextcache-k/system/library/extensions/

3. Ctrl +o disk, ctrl+x exit

4. Once the driver is moved, run it once in the terminal Sh/clean

————————————————————————————————————

Little Tricks

  Use the Tab key to auto-complement commands

For example, think of the/system directory, enter the Cd/sy and then press the TAB key, the command will automatically fill into equal Cd/system

Manipulate files and directories with spaces in the name

Spaces are written in the command, for example, to enter My Documents, the command is CD My Documents

  View detailed help for a command

Man command name (#add manual)

For example, to see the detailed use of the LS command, execute the man ls

————————————————————————————————————

 Typical Operating Procedures

(assuming you've made a clean script, remember to sudo-s get system permissions before each operation)

Suppose you download a video card driver Natit.zip, the desktop decompression to get a natit.kext, how to do it?

For the sake of insurance, back up all the drivers first.

mkdir/user/User name/desktop/backup Create a backup folder on the desktop

Cp-r/system/library/extensions/*/user/User name/desktop/backup backup driver file

Now you can install it safely.

Cp-r/user/user name/desktop/natit.kext/system/library/extensions copy it to the system-driven directory location

Sh/clean Execute cleanup Script, Operation complete

Re-boot failed, into the desktop, found that should not be the driver, how to recover it?

Power on F8, start with-s parameter

Execute MOUNT-UW/

rm-rf/user/User name/desktop/natit.kext Delete this driver

Sh/clean Execute cleanup Script, Operation complete

Restart, back to the original state, do not forget Ah, no special effects how to do it, and heard the need to modify the Natit Info. plist file is fine.

Cp-r/user/user name/desktop/natit.kext/system/library/extensions copy it to the system-driven directory location

Nano/system/library/extensions/natit.kext/info.plist

After editing, use Ctrl +o to save, ctrl+x exit

Sh/clean Execute cleanup Script, Operation complete

Restart, this time, the Carter effect has been, the sound card, God knows what will happen, we have to protect the existing results.

mkdir/user/User name/desktop/gooddrivers to create a directory for valid drivers

Cp-r/system/library/extensions/natit.kext/user/user name/desktop/gooddrivers backup

This sound card requires Applehda.kext to delete and edit the Appleazaliaaudio.kext in the Info.plist file, who knows later will not still use AppleHDA it, rather temporarily disable it.

mkdir/system/library/extensions/disabled Creating a disabled directory

Mv/system/library/extensions/applehda.kext/system/library/extensions/disabled move Past

Nano/system/library/extensions/natit.kext/appleazaliaaudio.kext/info.plist

After editing, use Ctrl +o to save, ctrl+x exit

Sh/clean Execute cleanup Script, Operation complete

Code management Tools

I'm using Sourcetree. You can use Git to manage projects

File comparison

Visual diff

The development machine can use the virtual machine, the tutorial see this blog post

end!

A summary of knowledge about Apple development

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.