MAC m1 PRO install Android phone emulator

Background: I am a product manager. The company has developed several Android apps. Mobile phones and notebooks are Apple products. Occasionally, they need to demonstrate and test them. Finally, I found a solution for installing an Android emulator on a mac. I will record and share it here.

Don't talk nonsense, go directly to the steps, follow the steps in detail and you will be able to complete it! ! !

Related resources (see below while downloading):

1. Huawei AppGallery installation package (link: https://pan.baidu.com/s/18XcPZwRgLJ7DCrI0gvYGUg extraction code: 1sd9)

2. Android image (link: https://pan.baidu.com/s/10oXiTv0P9LE1SGidGQJp5A extraction code: qi1u)

Step 1. Install Homebrew

If your Mac has not installed Homebrew, install Homebrew first, Homebrew is a very good package management tool on Mac. A domestic one-click installation script is recommended. The script will automatically set the domestic source, copy and paste the installation command to the terminal, press Enter to start execution, and complete the installation according to the prompts.

/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"

Step 2. Install ADB

The normal operation of the virtual machine requires ADB. Copy the following command to the terminal and press Enter, and install it according to the prompts. If the installation fails, try 2 more times.

brew install android-platform-tools

Check if the installation is successful

adb devices

Check where it's installed

brew info android-sdk

Step 3. Install the Android image (Android-Emulator)

Use the resource "2. Android image" provided above to install directly.

Move Android-Emulatorthe files to the directory, open the application Applicationsin the launchpad (it might be a bit slow to load for the first time).Android-Emulator

You will be prompted at the first startup 无法验证开发者, ignore the pop-up window, go to 系统设置-安全性与隐私, unlock the authentication, click to  取消 close the pop-up window, select in the preferences 仍要打开, and the first startup is complete.

ps: After the first installation, there will be a very strange prompt box, don't worry, you can turn it off after setting it in the next step.

Step 4. Configure ADB

Open the settings window of the virtual machine - Settings;

Uncheck it Use detected ADB location, click the folder icon behind to find the ADB file; path /opt/homebrew/Caskroom/android-platform-tools/33.0.1/platform-tools/adb

Do not display the /opt directory in the system root directory, use shortcut keys  ⌘⇧.(Command + Shift + .)to quickly (in Finder) display hidden files;

Follow the directory to find the adb file, click open, and restart the virtual machine without displaying a pop-up window to indicate that the configuration is complete.

·Click the three dots in the lower right corner

·Click the left menu settings, find use detected ADB location and close it, click the folder icon to select the location

· Location /opt/homebrew/Caskroom/android-platform-tools/33.0.2/platform-tools/adb, follow this path to find

ps: If you cannot see the opt folder, you can press command + Shift + . to display hidden folders

Finally find this adb and select it, click Open

 ·It can be closed after setting, and the configuration file needs to be set later.

 

Step 5. Modify the basic settings of the virtual machine

Find the emulator icon in the application, right-click and select "Show Package Contents", and follow this path to find /Contents/MacOS/api30-gphone-arm64-v8a/config.in

ps: The emulator has no icon by default, I replaced this one, and I will talk about how to replace it later

 

·Modify the content in the red box

 After modifying the configuration, you need to delete the userdata-qemu.img file in the current folder

Step 6. Add an icon

Find the emulator in "Applications", right click and select "Show Profile"

·Drag the png image you like to the upper left corner, wait for the green plus sign to appear, and release it.

 Step 7. Set the language

  After the above steps are completed, you can restart, and then set the Chinese language

ps: I have already added Chinese here, so select "Add Language" and scroll to the end to find Chinese. After the addition is complete, you can click the 2 horizontal lines on the right to move up to the first place.

Step 8. Add HUAWEI AppGallery

·Drag the installation package directly, and then download the APP you like.

· Seeing that it is finally completed here, it is hard work.

ps: The mobile phone will prompt that there is no network, but in fact there is network, don’t worry about it, you can download APP at will in the application market; and the built-in Google browser cannot be used, it should be that the developer has not developed it yet.

Summarize

The installation process will be a bit complicated, but it is also a gratifying thing to be able to brush black threads on Douyin in the end (manual dog head).

Guess you like

Origin blog.csdn.net/weixin_41677874/article/details/125559161