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

Thursday, July 28, 2016

Mac 如何设置外接显示屏 竖屏?

Mac  如何设置外接显示屏  竖屏?


今天,想让外接显示屏竖屏?

很简单。把你的鼠标移到 你想设置的外接显示屏上面。 然后,移到下面,打开设置, 打开显示器(display)

you can see





在这里,你可以旋转四种角度,根据自己的需要吧,

默认是的 Standardm 你只需要选择 选装 90 度, 确定就可以了!



就是这么简单的事情!

竖屏的世界,还是不错的,你可以尝试一下的奥。 还不错的!




Friday, July 22, 2016

Restart, Start, Stop MySQL from the Command Line Terminal, OSX, Linux

Thanks to:
https://coolestguidesontheplanet.com/start-stop-mysql-from-the-command-line-terminal-osx-linux/



To restart, start or stop MySQL server from the command line, type the following at the shell prompt…
On Linux start/stop/restart from the command line:

 /etc/init.d/mysqld start
 /etc/init.d/mysqld stop
 /etc/init.d/mysqld restart

Some Linux flavours offer the service command too
 service mysqld start
 service mysqld stop
 service mysqld restart

or
 service mysql start
 service mysql stop
 service mysql restart


On OS X to start/stop/restart MySQL pre 5.7  from the command line:

 sudo /usr/local/mysql/support-files/mysql.server start
 sudo /usr/local/mysql/support-files/mysql.server stop
 sudo /usr/local/mysql/support-files/mysql.server restart

On OS X Yosemite/El Capitan to start/stop/restart MySQL post 5.7  from the command line:

sudo launchctl load -F /Library/LaunchDaemons/com.oracle.oss.mysql.mysqld.plist
sudo launchctl unload -F /Library/LaunchDaemons/com.oracle.oss.mysql.mysqld.plist

Thursday, April 7, 2016

Mac Default website Congratulations, your Nginx seems to work just fine. :)

When I install nginx in the Mac, I met this question today,


猜测:
应可能是  nginx 代理了www.google.com 然后直接跳到了自己默认的网址!
目前不知道原因, 在解决

终于解决了,我们可以看到,其实是我们的www.google.com  被劫持了,我们输入的www.google.com 被重定向到了 nginx work!
不扯犊子,解决方案:
只有Safira Browser have the question.

Click command + ,

Click privacy button



you can click Remove All Website Data or  click   Detail button

you can see 


Remove ALL 
It works for me!

OK 



我想重启一下 nginx , 然后出现下面的问题:

nginx: [error] open() "/usr/local/var/run/nginx.pid" failed (2: No such file or directory)





It won't start because the 8080 port is in use 





What is nginx.pid file?
What the important?


First we should know the port is being used?

Mac :

you can input 

netstat -anp tcp | grep 8080
you will get some info


If you Mac system is "EI Caption"
you should input 
lsof -i tcp:8080


How to look process pid number?
int the bash input :

ps -ax | grep nginx 

you can see this link:
http://www.chriswrites.com/how-to-view-and-kill-processes-using-the-terminal-in-mac-os-x/



ps -au | group nginx 

查询出来的Pid ,
然后使用  kill  pid

但是,kill 之后,又会有新的 进程出现,我不知道为什么 我的nginx 这么吊!
看来是我配置的问题呀!




I  will meet this question:

nginx: [error] invalid PID number "" in "/usr/local/var/run/nginx/nginx.pid"


Resolve method:

$ sudo nginx -c /usr/local/etc/nginx/nginx.conf

$ sudo nginx -s reload


-c  just you change file!
-s  reload nginx!

OK

you can check it by 

netstat -aup tcp | grep portNumber



Nginx   





Wednesday, April 6, 2016

How to use man?

I think man is the best tool for unix system,  All like unix system will support man.


man -h  
you will get help

man -ps 
you will get you want to ps information

click q  you can exit man

enter you can see more info about you look command

Thursday, March 31, 2016

Macx 老是弹出 提示?

很讨厌,我不喜欢这种感觉,搜了一下 没找到!

I can find the resolve method!

So i guess it is safari, So I open the Sarafi

command + ,

open the setting page.

You can see, you want for example:


you just Remove all,

OK  iw works for me!


Thursday, March 24, 2016

如何在Mac 里配置alias 快速的使用 快捷键

1 编辑   .bash_profile 一般这个文件都不存在,需要新建!

2  vim  ~/.bash_profile 添加
  alias go='cd /home/etc'

注意这里等号前后不要出现空格

3  重新加载 .bash_profile
source .bash_profile 

4 you just in the terminal input  go, You will go to you want.

Tuesday, February 23, 2016

只用root 用户验证了ssh key,可以不用输入密码登录, 普通用户只能通过密码登录

这两天 一直在研究, 为什么自己的Git 登录的时候老是需要输入密码,但是我已经设置了SSH keygen 给VPS 的普通的用户了,还是需要我输入信息,这让我很恼火的!

这两天一直在研究为什么?

找到了原因在这篇博客:

因为 etc/ssh/sshd_config

中有一个参数:
PermitRootLogin yes

所以,只有root用户才有权限使用ssh,其他的用户就算是 添加了ssh  id_rsa.pub key 也是没有用的!依然需要输入密码!


最终解决方案:

将你的 密码设置的短一点!
  哈哈哈




Thursday, February 18, 2016

Mac chown how to use?

The base information:


5down voteaccepted
The permissions drwx---r-x+ break down as follows:
  • d is a directory, of course.
  • rwx means it's readable, writeable and accessible by the user. These three bits can be represented by the octal number 7.
  • --- means that the three aforementioned bits are NOT set for the group assigned to the directory. No bits are set, so the octal number is 0.
  • r-x means that users who aren't matched by the first two categories -- that is, everybody else, or "other" -- can read and access content of the directory, but can't write to it. The bits here are in the ones column and the fours column, so the octal number that represents this permission is 5.
  • + indicates that there is "extended security information" associated with this directory which isn't shown in standard ls "long format". An access control list, for example.
To set the basic permissions of this directory, you can use either the octal short-hand:
$ chmod 705 directoryname
or you can use the "symbolic" representation:
$ chmod u+rwx,g-rwx,o+rx-w directoryname
Obviously, the shorthand is ... shorter.
For the extended security information denoted by the +, you'd need to find out what is set up in order to replicate it. The ls command has a -e option to have it show extended security settings.
To actually set your ACLs from the command line, you'd use chmod'a =a-a and +a options. Documentation about this is available in OSX from man chmod. From that man page:
         Examples
          # ls -le
          -rw-r--r--+ 1 juser  wheel  0 Apr 28 14:06 file1
            owner: juser
            1: admin allow delete
          # chmod =a# 1 "admin allow write,chown"
          # ls -le
          -rw-r--r--+ 1 juser  wheel  0 Apr 28 14:06 file1
            owner: juser
            1: admin allow write,chown


http://stackoverflow.com/questions/29068724/how-to-get-drwx-r-x-folder-permission-using-chmod-bash-script

Saturday, December 19, 2015

Monday, October 19, 2015

Android studio gradle is so slow?

Why?



I think, you must know every program you can see ./gradle directory. Yes it is you download the gradle info just for your current program!  So when you install a new program you will find it is so slowly.  

I think we can just set gradle setting for all program, you just one setting and run everywhere.

like this:

detail:  
you may meet  the gradle home is incrract. 

you can see the url:http://stackoverflow.com/questions/21646252/how-to-set-gradle-home-while-importing-existing-project-in-android-studio


========================================

if  you choise the use local gradle distribution, There is some question. because the gradle is usualy update tool. So you use local gradle, Some days later, you will find the program can build. Because the gradle version hase new plugins or new version.

you can follow this way can reslove the  gradlw slowlly:
http://stackoverflow.com/questions/16775197/building-and-running-app-via-gradle-and-android-studio-is-slower-than-via-eclips







Mac hot to set Androdi_HOME


you can follow me:

1 .
export ANDROID_HOME=/Users/Hades/Library/Android/sdk

2.
Once you have this set, you need to add this to the PATH environment variable



export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools


reference:

http://stackoverflow.com/questions/19986214/setting-android-home-enviromental-variable-on-mac-os-x

========================================

The right answer:
1
you can up method. but you will find that  when you restart you mac pc, your adb can't use in terminal. So in a ward, the first way just for one time setting. But how to set Path forever

you can look this url:https://seo-michael.co.uk/how-to-setup-adb-on-os-x/

it is useful for me.

i do for this way, but when i kill the termial. when i input 
echo $PATH,  there is nothing to print!
I don't know why?  So i just restart the computer. you will find your setting is success!

just so so!

Wednesday, October 7, 2015

Mac 如何隐藏和不隐藏 文件夹?

3)通过修改文件的隐藏属性
在终端中输入chflags hidden 然后将文件拖到这里,按return执行即可隐藏文件。
chflags是一个更改文件隐藏属性的命令,他的意思就是change flags,也就是修改文件的标志,hidden就是隐藏,所以chflags hidden就是隐藏文件。如果要取消隐藏文件,只需要输入“chflags nohidden 文件”即可。


Thursday, September 24, 2015

Mac pro hot to support NTFS?

Windows uses the NTFS file system for its hard drives. Mac OS X can read files on NTFS hard drives, but it can't write files to them, which is a glaring omission. Attempting to drag a file into an NTFS drive in Mac OS X will only result in your mouse cursor turning into an error sign. Since many Hackintoshes dual-boot Windows and Mac OS X, being unable to share files between hard drives can lead to a lot of problems with file management. Fortunately, you can enable NTFS writing on OS X with relatively little trouble-- all it takes is a few drivers and 10 minutes of your time.



This mini-guide merely repeats what we said in our last article about enabling NTFS write capabilities in Mac OS X, from back in 2012. Of course, a bit has changed since then. Nowadays, you can actually just skip third-party drivers altogether by enabling Apple's native NTFS drivers through Terminal instead. Despite these developments, however, we still recommend that you follow this guide and install third-party drivers anyways. It's simpler, and you don't need to use Terminal. (Here at MacBreaker, we have a policy of avoiding the use of Terminal whenever possible.) This solution is compatible with every version of Mac OS X since Snow Leopard, including Lion, Mountain Lion, Mavericks, and even Yosemite.

UPDATE (October 27, 2014): Yes, this still works on OS X Yosemite! You may have to update OSXFuse, but that's it.

UPDATE (September 12, 2014): Niresh (Hackintosh Zone) has combined the 3 separate drivers listed in this guide into a single all-in-one NTFS driver package, which is quicker and easier to install. However, the download process on Niresh's website is a bit convoluted, so it's up to you whether you want to try his new driver package, or just stick to the current method detailed in this guide (either way, the results are the same).

1. Install FUSE for OS X
Download and install OSXFUSE on your computer. While it won't enable NTFS write in Mac OS X by itself, FUSE is a necessary "building block" for pretty much any Mac driver that deals with third-party file systems (including the NTFS file system).

DOWNLOAD: FUSE for OS X

While installing FUSE for OS X, be sure to check the "MacFUSE Compatibility Layer" option in the installer. You'll need it for the next step, in which we install the NTFS-3G driver-- that driver hasn't been updated in a while, so it needs this extra compatibility layer to work properly.

2. Install NTFS-3G
Next, download and install NTFS-3G. This is the driver that will actually enable NTFS write capabilities on your computer.

DOWNLOAD: NTFS-3G

During the installation process, you'll be given an option to install the NTFS-3G driver with either "No caching" or "UBLIO caching". While it probably won't actually matter, you may want to choose "No caching" to be safe. Either way, can always change this setting afterwards. Then, once the installation is finished, reboot your computer.

Back in the days of Mac OS X Snow Leopard, you could simply install this driver by itself (along with MacFUSE, the predecessor to OSXFUSE), and then Mac OS X would have NTFS writing capabilities automatically. Unfortunately, development of NTFS-3G has since stopped, which is why we need to do a bit of extra work to make everything run right.

3. Install fuse-wait
The first time you boot into Mac OS X after installing NTFS-3G, you'll probably be bombarded with error messages about your hard drives. Technically, this means that NTFS-3G is working correctly; you should now be able to write files onto your NTFS drives in Mac OS X. However, you'll probably want to get rid of these annoying error messages. To do that, download and install the fuse_wait patch for NTFS-3G.

DOWNLOAD: fuse_wait

Once fuse_wait is installed, that's all there is to it! You should now be able to write files onto NTFS hard drives in Mac OS X, seamlessly and without any errors. Congratulations!

Sunday, September 13, 2015

Mac Tools

I  love mac pro very much!  This is cery usefull Tool for me!


1  Beetmobile   it is useless  for me!
  I don't love this tool! because  it you install the tool. it is useless!



Sunday, September 6, 2015

Why my mac Android studio ButterKnife doesn't work , Genarate --> have no butterknife chose?

Now I know I am newser to Android!

Today I reslove the problem! Why  my mac Android studio  ButterKnife  doesn't work ,    Genarate -->  have no butterknife chose? I spend a long time!  Because I don' know the question occer where?

But now I know, The deep because is that:  I forget set Android studio Plugins. I din't know before. beacuse the last time is my brother to set Plugins for me. Not I do it myself! 

Folling this way:
Step one:
     Click the Setting Coin or keymap


Step Two
   You just shoud inpur ButterKnife Zelezny . You can see the Browse. just click it.


  Strp 3: 
   The esayest method: just install plugin!

  Let me see:




Thinking the question:

I should know my IDE very much . So now  I am loser to Android . So I have a long way to go!



Tuesday, August 25, 2015

Mac Android studio 最全的快捷键

-- 熟练使用快捷键 : 在任何编程环境中, 熟练使用环境提供的快捷键会大大提高编程效率, 在 Android Studio 中也不例外, 熟练使用其快捷键是 Android 开发者必备的技能之一, 这里根据官网提供的列表, 我自己总结使用了一遍, 将快捷键使用记录以及使用后的效果都展示给大家; 
-- 只适用于 MAC 操作系统 : 该快捷键总结的时 MAC 中的 Android Studio 的快捷键;



一. 快捷键设置


1. MAC 中得特殊键


MAC 中得特殊符号 : 
-- Command () : ⌘ ;
-- Control : ⌃ ;
-- Option (alt) : ⌥ ;
-- Shift : ⇧ ;
-- Caps Lock : ⇪ ;


2. Android Studio 快捷键设置



设置按钮 : 点击 Android Studio 菜单, 选择 Preferences 配置;

快捷键设置 : 在 Preferences 设置中, 选择 IDE Settings 设置中的 Keymap 快捷键设置;

3. Android Studio 快捷键模式设置



快捷键模式设置 : 在 Android Studio 中也可以使用 eclipse 中的快捷键, 在此时点击 keymap 即可选择快捷键模式;
-- keymap 键位置 
-- 可选模式 : 选择 Eclipse 模式, 此时快捷键与 eclipse 中得快捷键基本相同;




二. Android Studio 默认快捷键详解




1. 编辑相关快捷键



(1)V. 自动完成代码 Control + Space 



快捷键 : Control + Space  自动完成代码;


(2)V. 智能自动完成代码 Control + Shift + Space



快捷键 : Control + Shift + Space  智能自动完成代码 ; 效果 与 Control + Space 效果差不多;


(3) 完成声明 Control + Shift + Enter


快捷键 Command + Shift + Enter , 完成声明如果最后没有分号, 添加分号, 如果有分号, 则换行;


(4) 查看方法参数方法 Control + P


查看参数 : Control + P  查看方法参数 ; 


(5)V. 查看选中的元素文档 Control + J | F1


快捷键 : Control  + J  或者 F1  查看选中元素的相关文档;


(6)V. 查看网页文档 Shift + F1


快捷键 : 点击 Shift + F1  查看该元素的网页文档;
-- 选中该元素 : 
-- 使用 Shift + F1 快捷键弹出下面网页 : 


(7)V. 查看元素简短说明 Command + 鼠标左键


快捷键 : Command + 鼠标左键  查看元素简短说明 ; 


(8)V. 生成代码 Command + N | Control + 回车


生成代码快捷键 : Command + N  或者 Control + 回车  生成代码;
 


(9)V. 覆盖重写方法 Control + O


覆盖重写方法 : Control + O  覆盖重写方法 ;


(10) 实现方法 Control + I


覆盖重写方法 : Control + I  实现方法 ;


(11)V. 生成代码块 Command + Option + T



生成代码块快捷键 : Command + Option + T  生成代码快捷键;
-- 使用方法 : 首先选中一部分代码, 使用 Command + Option + T 会弹出下面的对话框;


(12)V. 代码注释 Command + / | Command + Option + /


注释快捷键 : Command + / 或者 Command + Option + /  代码注释;
-- Command + / : 单行注释;
-- Command + Option + / : 多行注释;



(13)V. 增大缩小选择范围 Option + Up/Down



选择范围快捷键 : Option + Up/Down 扩大 缩小快捷键;
-- 最小状态 : 
-- 多次按 Option + Up 扩大后选择 


(14) 查看当前所在类 Control + Shift + Q


快捷键 : Control + Shift + Q  查看当前光标所在类 ;


(15)V. 查看当前元素可操作项目及快速修改 Option + 回车


快捷键 : Option + 回车 , 查看当前元素的可操作项 或者 快速修改 ; 


(16)V. 格式化代码 Option + Command + L


格式化快捷键 Option + Command + L   格式化代码;

(17)V. 自动优化导入包 Control + Option + O


清除包快捷键 : Control + Option + O  自动优化导入包 ;

(18)V. 自动行缩进 Control + Option + I


清除包快捷键 : Control + Option + I  自动行缩进 ;
-- 未缩进前 : 
-- 使用快捷键缩进后 


(19)V. 逐个字母选中 Shift + Left/Right


快捷键 : Shift + Left 或者 Shift + Right  逐个字母选中 ;


(20)V. 复制一行到下一行 Command + D


快捷键 Command + D  自动复制选中行 到下一行中;


(21)V. 删除一行 Command + Delete


删除行快捷键 : Command + Delete 或者 Command + X  可以实现删除行效果;



(22)V. 合并行 Control + Shift + J


快捷键 : Control + Shift + J  可以实现合并行效果;
-- 合并前 : 
-- 合并后 : 


(23)V. 分成两行 Command + 回车


快捷键 : Command + 回车  可以实现分成两行行效果;
-- 合并前 : 
-- 合并后 : 


(24)V. 在下一行自动添加一行 Shift + 回车


自动添加行 : shift + enter  自动在下一行添加行;


(25)V. 大小写字母转换 Command + Shift + U


大小写转换 Command + Shift + U   大小写字母转换;
-- 转换大写字母 
-- 转换小写字母 : 



(26) 删除单个字母 Option + Delete


快捷键 Option + Delete   删除单个字母;


(27)V. 展开单个方法或类 Command + Minus/Plus


展开单个类 : Command + Minus/Plus 折叠/展开类 ;
-- 展开类 : Command + Plus;
-- 折叠类 : Command + Minus;


(28)V. 展开折叠所有方法或类 Command + Shift + Minus/Plus


展开关闭所有类 : Command + Shift + Minus/Plus  折叠/关闭所有类;
-- 展开所有类 : Command + Shift + Plus ;

-- 折叠所有类 : Command + Shift + Minus ;



(29)V. 关闭当前的文档 Command + W


快捷键 : Command + W  关闭当前文档;



2. 查找替换相关快捷键


(1)V. 随意查询 Double Shift


快捷键 : Shift + Shift  随意查询;


(2)V. 查找文本 Command + F


查找文本快捷键 : Command + F  查找文本 ;


(3) 查找下一个 Command + G


快捷键 : Command + G  查找下一个选中元素;

(4) 查找上一个 Command + Shift + G


快捷键 Command + Shift + G  查找上一个选中元素;


(5)V. 替换文本 Command + R


替换文本快捷键 : Command + R  替换文本;


(6) 在路径中查找 Command + Shift + F


快捷键 : Command + Shift + F  在路径中查找 ;
-- 查找对话框 : 
-- 查找结果 : 


(7)V. 全局查找调用 Option + F7


快捷键 : Option + F7 在全局查找该元素


(8) 本文件查找定义 Command + F7


快捷键 : Command + F7  跳转到本文件定义处 ;



(9)V. 高亮本文件选中元素 Command + Shift + F7


快捷键 : Command + Shift + F7  高亮本文件选中元素 ;


(10)V. 查找选中元素调用 Command + Option + F7


快捷键 : Command + Option + F7  查找选中元素调用 ;



3. 编译 运行 相关快捷键


(1)V. 编译整个工程 Command + F9



快捷键 : Command + F9 , 编译整个工程 ;



(2)V. 编译选中的文件 包 模块 Command + Shift + F9


快捷键 : Command + Shift + F9 , 编译选中的文件 包 模块 ;


(3)V. 选择配置并运行 Control + Option + R


快捷键 : Control + Option + R , 选择一个配置并运行 ;

(4)V. 选择配置并 Debug 调试 Control + Option + D


快捷键 : Control + Option + D , 选择一个配置并 Debug 调试;
-- 选择配置 : 
-- Debug 调试面板 : 


(5)V. 运行 Control + R


快捷键 Control + R , 运行默认项目;

(6)V. 调试 Control + D


快捷键 Control + D , 调试默认项目;


(7)V. 运行当前编辑文件所在的模块 Control + Shift + R


快捷键 Control + Shift + R , 运行当前编辑文件所在模块;

(8)V. 调试当前编辑文件所在的模块 Control + Shift + D


快捷键 Control + Shift + D , 调试当前编辑文件所在模块;




4. 调试相关快捷键


(1)V. 执行下一行 F8


快捷键 : F8 , 执行下一行调试;


(2)V. 进入方法调用 F7


快捷键 : F7 , 进入方法中调试;


(3) 智能进入方法调用


快捷键 : Shift + F7 , 智能进入方法调用;


(4) 跳出方法


快捷键 : Shift + F8 , 跳出方法调用;


(5)V. 运行到光标所在行 Option + F9


快捷键 : Option + F9 , 运行到光标所在行;
-- 运行之前 : 
 
-- 运行之后 : 


(6)V. 获取表达式值 Option + F8


快捷键 : Option + F8 , 获取表达式的值;

(7)V. 重置程序 Command + Option + R


快捷键 : Command + Option + R , 重置程序, 退出 Debug 调试;


(8) 显示隐藏断点 Command + F8


快捷键 : Command + F8 , 显示隐藏添加断点;
-- 说明 : 如果没有断点, 就会添加断点, 如果有断点, 点击断点就会消失 ;

(8) 显示所有断点 Command + Shift + F8


快捷键 : Command + Shift + F8 , 显示所有断点;

5. 重构相关快捷键



(1) 拷贝 F5


快捷键 F5 , 拷贝;
-- 拷贝对话框 : 


(2) 拷贝 F6


快捷键 F6 , 移动;
-- 移动对话框 : 

(3) 安全删除 Command + Delete


快捷键 Command + Delete , 安全删除;


(4) 重命名 Shift + F6


快捷键 Shift + F6 , 重命名;
-- 重命名文件 : 
-- 重命名方法 变量 : 


(5) 重新设置参数 Command + F6


快捷键 Command + F6 , 重新设置参数;

(6) 提取方法 Command + Option + M


快捷键 Command + Option + M , 提取代码到方法中;


(7) 提取变量 Command + Option + V


快捷键 Command + Option + V , 提取变量;
-- 快捷键使用前 : 
-- 快捷键使用后 : 


(8) 提取成员变量 Command + Option + F


快捷键 Command + Option + F , 提取成员变量;


(9) 提取常量 Command + Option + C


快捷键 Command + Option + C , 提取常量;
-- 原来的常量值 : 
-- 选中后的常量值 
-- 修改常量值 : 
-- 定义的常量 : 


(10) 提取参数 Command + Option + P


快捷键 Command + Option + P , 提取参数;



6. 导航相关快捷键



(1) 查找类 Command + O


快捷键 : Command + O , 查找类并进入 ;


(2) 查找文件并进入 Command + Shift + O


快捷键 : Command + Shift + O , 查找文件并进入 ;


(3) 查找文件并进入 Command + Option + O


快捷键 : Command + Option + O , 查找字符串并进入 ;


(4) 进入指定的某行 Command + L


快捷键 : Command + L , 进入某一行 ;

(5) 显示最近编辑的文件列表 Command + E


快捷键 : Command + E 快捷键是 显示最近编辑的文件列表;
-- 弹出对话框 : 


(6) 到上一个/下一个光标位置 Command + Option + Left|Right


快捷键 : Command + Option + Left | Command + Option + Right 快捷键是 到上一个|下一个光标位置;


(7) 查看元素所在面板位置 Option + F1



快捷键 Option + F1  正在编辑的元素在各个面板中定位 ; 




(8) 查看元素声明 Command + B | Command + 鼠标左键


快捷键 : Command + 鼠标左键 | Command + B  查看元素声明或定义 ; 



(9) 查看元素子类 Command + Option + B


快捷键 : Command + Option + B  查看元素子类 ; 


(10) 查看方法变量定义 Option + Space | Command + Y


快捷键 : Option + Space | Command + Y  查看元素定义 ; 


(11) 查看类型定义 Command + Shift + B


快捷键 : Option + Shift + B  查看类型定义 ; 
-- 使用效果 : 选中变量, 使用该快捷键, 进入该变量类型定义的类;



(12) 跳转到父类方法或父类中 Command + U


快捷键 : Command + U  跳转到父类方法或父类中 ; 
-- 跳转前位置 : 
-- 跳转后的位置 : 


(13) 跳转到父类方法或父类中 Command + U


快捷键 : Command + U  跳转到父类方法或父类中 ; 



(14) 查看当前文档结构 Command + F12


快捷键 : Command + F12  查看文档结构;



(15) 查看当前类的继承结构


快捷键 : Control + H  查看当前类的继承机构;


(16) 查看当前方法的继承结构


快捷键 : Control + Shift + H  查看当前方法的继承结构;



(17) 查看当前方法的调用结构


快捷键 : Control + Option + H  查看当前方法的调用结构;



(18) 查看当前方法的调用结构


快捷键 : Control + Option + H  查看当前方法的调用结构;


(19) 上一个/下一个 高亮错误


快捷键 : F2 | Shift + F2  上一个/下一个 高亮错误;


(20) 查看方法 变量内容


快捷键 : F4 | Command + Down  上一个/下一个 高亮错误;


(21) 设置标签


快捷键 : F3 设置隐藏标签;



(22) 设置带标记的标签


快捷键 : Option + F3 设置带标记的标签;
-- 设置标签过程 : 
-- 设置好的标签 : 


(23) 跳转到带数字0~9标记的标签


快捷键 : Command + F3  显示标签;


7. 模板代码相关快捷键



(1) 包裹代码


快捷键 : Command + Option + J  使用现有代码包裹;


(2) 插入代码


快捷键 : Command + J  插入现有代码;



8. 其它相关快捷键



(1) 最近修改的代码


最近修改快捷键 Option + shift + C  显示最近修改的代码 ;


(2) 关闭打开文档



快捷键 Shift + 鼠标左键 点击文件标签, 即可 关闭打开的文档;


(3) 查看当前文档警告错误



查看警告错误位置 : F2  查看该文件错误警告位置;


(4) 查看当前文档结构


快捷键 : Command + F12  查看文档结构;


(5) 查看当前元素在当前文档处的引用


查看元素位置 : 
-- 快捷键 option(alt) + F7   查看当前元素在当前文件中引用;



(6) 跳转到光标处


跳转快捷键 : 
-- Command + [ :  移动到上一个光标停放处 ;
-- Command + ] :  移动到下一个光标停放处 ;


(7) 增大缩小选择范围


选择范围快捷键 : Option + Up/Down 扩大 缩小快捷键;
-- 最小状态 : 
-- 多次按 Option + Up 扩大后选择 



(7) 跳转到行 开头/结尾


跳转到行开头/结尾 : Command + Left/Right 跳转到行 开头/结尾;
-- Command + Left : 跳转到行开头;
-- Command + Right : 跳转到行结尾;


(8) 查看文档



查看文档 : F1  查看文档;



(9) 查找命令方法



查找命令快捷键 : Command + Shift + A  查找命令 ; 
-- 简介 : 如果遇到不会的快捷键命令, 可以在这里输入先关词 查找, 只限英文;


(10) 查看元素所在面板位置


高亮元素快捷键 : Control + Shift + F7  高亮元素在本文件中得出现选中的元素;


(11) 上下移动代码


移动代码快捷键 : Option + Shift + Up/Down(方向键)  将一行代码上移/下移一行;


(12) 生成代码块



生成代码块快捷键 : Command + Option + T  生成代码快捷键;
-- 使用方法 : 首先选中一部分代码, 使用 Command + Option + T 会弹出下面的对话框;


(13) 大小写字母转换


大小写转换 Command + Shift + U   大小写字母转换;
-- 转换大写字母 
-- 转换小写字母 : 




三. 参考文档链接


1. 参考文档



参考一 (快捷键列表) : 
-- MAC 快捷键 : CSDN 下载地址 : 点击打开链接 ;
-- Linux/Win 快捷键 : CSDN 下载地址 : 点击打开链接 ;


2. 参考链接



参考二 (文档) : 
-- Intellij IDEA 官方文档 : 点击打开链接;
-- Intellij IDEA MAC 快捷键连接 : 点击打开链接;
-- Intellij IDEA Linux 快捷键连接 : 点击打开链接;
-- Android Studio 快捷键大全 : 点击打开链接 ;
-- 史上最详细的Android Studio系列教程三--快捷键 : 点击打开链接 ;
-- Android Studio 快捷键 : 点击打开链接 ;
-- 快捷键博客 : 点击打开链接 ;