# Install simulator

The Android emulator can be installed on both MacOSX and Windows; the iOS emulator can only be installed on MacOSX.

# ios simulator

MacOSX, to install the ios simulator, you need to install xcode; or search for xcode in the App store to complete the installation.

Open the xcode installation, press the shortcut key command+, to open the Preferences window, as shown below:

In the above window, click [Locations], click [Command Line Tools]

# Run App to iOS Simulator

Project Manager, select the project to be run, click the run icon on the toolbar, as shown below:

The effect of running the app project to the iOS simulator is as follows:

# 运行到iOS模拟器功能限制

iOS模拟器和真机使用不同的CPU架构,部分模块依赖的三方SDK没有包含模拟器或者对模拟器兼容不好,导致无法在模拟器上正常运行,目前已知无法在模拟上使用以下功能:

  • 讯飞语音识别
    由于讯飞语音识别在新版本XCode编译后无法兼容iOS8.x模拟器,HBuilderX1.5及以上版本标准基座模拟器版本不再支持讯飞语音识别功能

注意:2024年3月21日审计云端打包环境为XCode15.2,不再支持讯飞语音识别,推荐使用百度语音识别模块。

  • 直播推流(live-pusher)
    直播推流功能是基于又拍云的推流SDK实现,又拍云的SDK不支持iOS模拟器,标准基座模拟器版本无法运行直播推流相关功能,请使用真机运行体验此功能。

# Android emulator

There are many full-fledged Android emulators on the market, so I won't recommend them here. Search and install by yourself.

Of course, Google officially has its own emulator, you can install different versions of the emulator in Android Studio.

The android studio emulator is shown below:

# Run the App to the Android emulator

After the Android emulator is started, HBuilderX will recognize it as an Android phone named emulator-xxxx, where xxxx is the id of the emulator as shown below:

The effect of running the app project to the android emulator is as follows:

# 鸿蒙模拟器

安装鸿蒙模拟器,需要先安装DevEco-Studio

Windows系统如使用模拟器则需要开启以下功能

打开控制面板 - 程序与功能 - 开启以下功能

  1. Hyper-V
  2. Windows 虚拟机监控程序平台
  3. 虚拟机平台

注意: 需要win10专业版或win11专业版才能开启以上功能,家庭版需先升级成专业版或企业版

# 运行App到鸿蒙模拟器

如果没有登录华为账号,此时需要先登录,登录成功后看到如下页面

选择模拟器型号,选第一个即可

安装完模拟器后,点击启动按钮启动模拟器

启动模拟器成功后,如果提示需要先签名(配置签名需要先启动模拟器后才能配置)

点击 DevEco-Studio 上方菜单 File - Project Structure...

在弹出的窗体中选择 Project - Signing Configs 并打钩 Automatically generate signature,即可自动生成签名

最后依次点击 ApplyOK 使签名生效