【Android】mac mini m2 install android studio

1. Environment construction

1.1 Installation path

windows:https://redirector.gvt1.com/edgedl/android/studio/install/2022.3.1.18/android-studio-2022.3.1.18-windows.exe
mac arm:https://redirector.gvt1.com/edgedl/android/studio/install/2022.3.1.18/android-studio-2022.3.1.18-mac_arm.dmg

1.2 mac arm

On the mac, use uname -a in the terminal to check whether the mac is arm64.
insert image description here

1.3 install android studio

insert image description here

cmd line tools
insert image description here

2. Install the sdk

Opening android studio may prompt that the sdk cannot be found. Don't worry, click next first, and then you can turn off the proxy in the setting and then turn it on again.
insert image description here
insert image description here

default path

/Users/youkai/Library/Android/sdk

insert image description here
insert image description here
Encountered a problem: the sdk cannot be installed. I uninstalled it before, and I deleted the directory under the sdk.

3. Update sdk

3.1 Turn off the proxy

Plugins – setting – HTTP Proxy setting – No proxy
needs to close the proxy first, then close stduio, and then reopen it to install
insert image description here
insert image description here

3.2 re-update sdk

insert image description here
insert image description here
insert image description here
insert image description here

After that, it can be automatically updated, and the update results are as follows
insert image description here

4. Update the api

Depending on your project requirements, android12 is 31, android13 is 33.
insert image description here
insert image description here
insert image description here
insert image description here

5. Project creation

insert image description here

Six, gradle installation

The gradle will be automatically obtained when the project is created, and the download is easy to disconnect. You can download the gradle yourself, and then configure the local path, instead of downloading it from the Internet every time.

https://www.jianshu.com/p/c0718c34060a

insert image description here

Installation URL: https://services.gradle.org/distributions/
build.gradle.kts: https://www.jianshu.com/p/7d37f899d37c

By default, the gradle downloaded from the Internet is used. Since the download is easy to be interrupted, you can directly use the local file after downloading and put it
in the local directory, and then drag the folder to the terminal to see the path.

insert image description here

gradle-wrapper.properties

distributionUrl=file:///Volumes/youkai_data/android_pro/gradle/gradle-8.0-bin.zip

Seven, avd

insert image description here
insert image description here
I have downloaded it, and if I haven't downloaded it, click the download button next to Tiramisu.

insert image description here

8. Problem: missing build tools

Prompt can not find build tools 33.0.1

insert image description here
insert image description here

By default, only 34 will be downloaded, and all package information needs to be displayed, just select the corresponding tools

Nine, compile and run

insert image description here

summary

So far, the project can be successfully created, compiled and run.
The development on mac is quite smooth.

Guess you like

Origin blog.csdn.net/qq_38091632/article/details/132174988