Summary of Apple development knowledge and Apple development knowledge
I have been doing Apple development for a long time. I have been in this industry for about four years. I started from a training company in Beijing to study iOS development, find a job, lose a job, lose confidence, and return to development. The process is complex. Today, I will summarize some of the operations that are commonly used in Apple computer operations and development environment XCODE and Common Terminal commands.
First, summarize the operations of the Apple system.
1.Mac system shortcut key symbol. This is crucial, because when we open a software, the shortcut keys often use the symbols shown in the figure below to represent the buttons of the actual keyboard.
For example, XCODE
If you do not know the keys represented by these images, you cannot use the shortcut keys.
2. Basic shortcuts
Command-Z undo
Command-X cut
Command-C Copy)
Command-V Paste
Command-A select All (All)
Command-S Save)
Command-F Find)
2. Shortcut Keys
Command-Shift-4 captures the selected screen area to a file
Command-Shift-3 captures all screens to files
Command-Shift-Control-3 capture all the screens to the clipboard
Command-Shift-4 captures the selected screen area to a file, or press the Space key to capture only one window
Command-Shift-Control-4 captures the selected screen area to the clipboard, or press the Space key to capture only one window
3. General application shortcut keys
Command-Option-esc open force exit window
Command-H Hide (Hide) the currently running application window
Command-Option-H Hide (Hide) other application windows
Command-Q exit (Quit) the first application
Command-Shift-Z Redo, that is, the Undo reverse operation
Command-Tab transfers the list of opened applications to the next recently used application, which is equivalent to Alt + Tab in Windows)
Command-Option-esc open the force exit window. If an application does not respond, select force exit from the window list.
4. Text Processing
Command-the right arrow moves the cursor to the end of the row
Command-B switch the selected text to Bold display
Fn-Delete is equivalent to the Delete operation on the PC's full-size keyboard, that is, deleting backwards.
Fn-Page Up)
Fn-Down Arrow scroll Down a Page (Page Down)
Fn-scroll to the beginning of the document (Home) with the left arrow)
Fn-right arrow scroll to the End of the document)
Command-the right arrow moves the cursor to the end of the row
Command-move the cursor to the beginning of the row with the left arrow
Command-The down arrow moves the cursor to the end of the document
Command-The up arrow moves the cursor to the beginning of the document
Option-move the cursor to the end of the next word with the right arrow
Option-move the cursor to the beginning of the previous word with the left arrow
Move Control-A to the beginning of A row or paragraph
5. Finder
Command-Option-V cut the file
Command-Shift-N create a folder (New)
Command-Shift-G call-up window, you can enter the absolute path to the folder (Go)
Return is not a shortcut. Click the file and press it to rename the file.
Command-O open the option. Opening a file on Mac is not like directly pressing Enter in Windows.
Command-Option-V is equivalent to file cutting in Windows. Copy the file (Command-C) elsewhere. Press this shortcut key at the destination location to cut the file to this location.
Command-The up arrow opens the folder containing the current folder, which is equivalent to "up" in Windows"
Command-Delete: Move the file to the recycle bin
Command-Shift-Delete clear the wastepaper basket
Space key to quickly view the selected file, that is, the preview function
6. Safari
Control-Tab to the next Tab
Command-L jump directly to the address bar
Control-Tab to the next Tab
Control-Shift-Tab switch to the previous Tab
Command-plus sign or equal sign enlarge page
Command-scale down the page
XCODE shortcuts
1. Xcode is mainly used to operate the display and hiding of XCODE and some environment settings.
Preferences are used to set Xcode environments, such as the color and size of the Code Editor text.
2. File is used to operate projects, create files, open projects, and so on.
New
Comman + N create a file
3. Edit is used to Edit files, and class names can be renamed.
4. View is used to display some Xcode windows.
5. Find is used to Find and replace the text in the project.
6. Navigate navigation
7. Editor
8. The Product is used to run and debug projects.
9. Debug
10. Source Control
11. Window
12. Help
Terminal commands
How to enter the command line operation mode
Open the application-utility-terminal with finder in the graphic interface
Basic commands
List objects
Ls parameter directory name
For example, I want to see what is in the directory,
Ls/
Want to see what is in the driver directory,
Ls/System/Library/Extensions
Parameter-w displays Chinese characters,-l details,-a includes hidden files
Conversion directory
Cd
For example, think of a loop in the driver directory.
Cd/System/Library/Extensions
Create a new directory
Mkdir directory name
For example, create a backup directory backup under the driver directory.
Mkdir/System/Library/Extensions/backup
Create a backup directory backup on the desktop
Mkdir/User name/Desktop/backup
Copy an object
Cp parameter source file target file
For example, you want to copy the Natit. kext file on the desktop to the driver directory.
Cp-R/User name/Desktop/Natit. kext/System/Library/Extensions
The R parameter indicates recursive operation on the directory. kext looks like a file on the GUI, but actually a folder.
Back up all files in the driver directory to the desktop backup
Cp-R/System/Library/Extensions/*/User name/Desktop/backup
Delete an object
Rm parameter file (rm-rf folder)
For example, you want to delete the driver cache.
Rm-rf/System/Library/Extensions. kextcache
Rm-rf/System/Library/Extensions. mkext
Parameter-rf indicates recursion and force. Be careful when using this parameter. If you run rm-rf/your system, it's all gone.
Move files
Mv File
For example, you want to move AppleHDA. Kext to the desktop.
Mv/System/Library/Extensions/AppleHDA. kext/User name/Desktop
I want to move 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 stands for change)
For example, set all files in the driver directory to root for read and write, while other users are read-only.
Chmod-R 755/System/Library/Extensions
The R parameter indicates recursion, and 755 indicates the permissions of each user.
Change file owner
Chown parameter User: group file
For example, change the owner of all files in the driver directory to the root user.
Chown-R root: wheel/System/Library/Extensions
The R parameter indicates recursive operation.
Fix file permissions in the entire system
Diskutil repairpermissions/
Strictly speaking, this is not a unix Command, but an osx software. Remember to modify or add the driver and execute it once.
Text editing
Nano file name
For example, edit natit Info. plist.
Nano/System/Library/Extensions/Natit. kext/Info. plist
After editing, press Ctrl + O to save the disk, and press Ctrl + X to exit.
Another text editing software is vi, which has some odd operations and is very easy to use. It is also used in all Unix-like systems.
Run the script command
Sh script file name
For example, after the driver is modified, all required operations are saved as a script. After the driver is modified, you only need to run the script once.
1. Run nano/clean in the terminal
2. paste the following code into 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. Press Ctrl + O to save the disk, press Ctrl + X to exit
4. Run sh/clean once on the terminal as long as the driver is activated.
------------------------------------
Tips
Use the Tab key to automatically complete the command
For example, enter cd/Sy in the/System directory and press the Tab key. The command is automatically merged into cd/System.
Operate files and directories with spaces in names
The space is written as a space in the command. For example, to enter My Documents, the command is cd My Documents ENTs.
View Detailed Help of commands
Man command name (# add manual)
For example, to view the detailed usage of the ls command, execute man ls
------------------------------------
Typical operation process
(Assuming that the cleanup script has been prepared, remember that sudo-s obtained the system permission before each operation)
Assume that you have downloaded a graphics card driver Natit.zip and obtained a Natit. kext file from the desktop. How can this problem be solved?
To be safe, back up all drivers first.
Mkdir/User name/Desktop/backup create a backup folder on the Desktop
Cp-R/System/Library/Extensions/*/User name/Desktop/backup driver File
Now you can install it with peace of mind.
Cp-R/User name/Desktop/Natit. kext/System/Library/Extensions copy it to the System driver directory
Sh/clean: Execute the cleanup script. The operation is complete.
An error occurred while restarting the desktop. I found that the driver should not be installed. How can I restore it?
Press f8. start with the-s parameter.
Run mount-uw/
Rm-rf/User name/Desktop/Natit. kext Delete this driver
Sh/clean: Execute the cleanup script. The operation is complete.
Restart and return to the original status. Don't worry. How can I do without special effects? I heard that I need to modify the Info. plist file of Natit.
Cp-R/User name/Desktop/Natit. kext/System/Library/Extensions copy it to the System driver directory
Nano/System/Library/Extensions/Natit. kext/Info. plist
After editing, press Ctrl + O to save the disk, and press Ctrl + X to exit.
Sh/clean: Execute the cleanup script. The operation is complete.
Restart. By the way, all the video effects are available. It's time to get the sound card. You know what will happen, and you have to protect the existing results.
Mkdir/User name/Desktop/gooddrivers create a directory for the effective driver
Cp-R/System/Library/Extensions/Natit. kext/User name/Desktop/gooddrivers backup
This sound card requires that AppleHDA. kext be deleted and edited. Who knows if AppleHDA will be used in the future.
Mkdir/System/Library/Extensions/disabled
Mv/System/Library/Extensions/AppleHDA. kext/System/Library/Extensions/disabled move past
Nano/System/Library/Extensions/Natit. kext/AppleAzaliaAudio. kext/Info. plist
After editing, press Ctrl + O to save the disk, and press Ctrl + X to exit.
Sh/clean: Execute the cleanup script. The operation is complete.
Code Management Tools
I am using SourceTree and can use git to manage projects.
File comparison
Visual diff
Developers can use virtual machines. For more information, see this blog.
END!