Android Studio on Mac
Now the company has developed Mac, and Android is also a beginner. Today, according to the recent introduction, we will describe Android Studio under Mac. I hope you will be enlightened.
1. Software Installation and environment Configuration
The software I installed is Android Studio, Genymotion, and VirtualBox.
First, Android Studio. First, install JDK on the official Oracle website. Then install Android Studio. I installed Android Studio1.1.0. The following is the 1.2 Preview 4 (including Windows and Linux), which can be downloaded directly after being tried.
Windows: http://dl.google.com/dl/android/studio/ide-zips/1.2.0.4/android-studio-ide-141.1809159-windows.zip (252 MB)Mac: http://dl.google.com/dl/android/studio/ide-zips/1.2.0.4/android-studio-ide-141.1809159-mac.zip (250 MB)Linux: http://dl.google.com/dl/android/studio/ide-zips/1.2.0.4/android-studio-ide-141.1809159-linux.zip (249 MB)
Install the sdk. Then, it prompts you to download the sdk. Let it download the sdk by yourself. After the download is complete, click Next. The installation is complete.
In fact, now Android Studio is ready for use, and no environment variables need to be configured. I also said it was amazing. The unique environment variable: adb (Android Debug Bridge)
Adb environment variable settings: open Terminal and enter open-e. press enter to open bash_profile. bash_profile file. It should be null if it has not been configured before. Input (export PATH =$ {PATH }:~ /Library/Android/sdk/tools :~ /Library/Android/sdk/platform-tools) There are no parentheses. These are two paths: tools and platform-tools. replace them with the path of tools and platform-tools under your computer SDK and save them. Terminal Input source. bash_profile, and then enter adb shell, it will not be not found.
You can install other software normally.
2. Android Studio usage and shortcut keys
(1) After creating a new Project, we can enter the interface. You can select Project or Android on the left side. Generally, selecting a Project is a habit of displaying eclipse.
(2) Click Preferences (shortcut: command +,) in the upper left corner of Android Studio. You can perform various settings here.
IDE Settings> Editor> Colors & Fonts
IDE Settings> Keymap to set the shortcut keys. You can select the shortcut keys for the eclipse version. We recommend that you use Mac OS for unified usage.
IDE Settings> Editor> Code Completion Case sensitive completion select None, so that the Code prompt will not be Case sensitive (by default, str will not prompt the String ).
(3) Common code shortcut keys
Option + enter automatic correction (Android Studio automatic import package)
Control + option + space code prompt
Command + c does not select to copy the current row, select to copy the selected content
Command + d do not select copy and paste the current row, select copy and paste the selected content
Command + x do not select to cut the current row, select to cut the selected content
Command + d do not select copy and paste the current row, select copy and paste the selected content
Command + B Open the class or method at the cursor
Control + r run project
Command +/comment
Command + alt +/multi-line comment
3. adb Monkey test
After configuring the adb environment variables, you can use some adb functions. You have seen a cool Monkey test (smoke test ).
Run the project on the simulator or on the real machine, and enter adb shell monkey-p [package name]-v [number of events] on Terminal, for example (adb shell monkey-p com. aa. bb. xx-v 10000), press enter to perform a rapid test. If any error occurs, you can see it on logcat. It's pretty cool to see it quickly.