Simulator

After the Mini Program project builds, it will run in the simulator automatically. You can click and slide in the screen to simulate the click and slide motion in real device.

By default, each time saving the changes of the code, the simulator will refresh automatically to achieve real-time update. If you want to disable the feature, cancel the auto refresh selection in the bottom of the simulator.

Simulator

The top of the simulator window mainly contains following functions:

  • Device switch: choose different size devices including iOS and Android. You can also create a custom device.
  • Scale control: control the scale of the Mini Program.
  • Refresh: compile the project and refresh the simulator.
  • Tools: tools for simulation data such as you can mock the location.
  • Simulation log: check the compile logs.
  • Standalone window: set the simulator to a standalone window.

The bottom of the simulator window mainly contains following functions:

  • Page path: show current page path. Click the path, the relative .js file will be opened automatically.
  • Page params: show the parameters of current page.
  • Auto refresh: checkbox for auto refresh of simulator.

Device Switch

The developer can select different devices or add custom device to debug the adaptation problem of Mini Program on the models of different sizes.

Simulator

Scale Control

The developer can scale the display of the simulator via preset percentages.

Simulator

Simulation Tools

The simulation tools is a useful function for developers. Click the tools menu, you can display or hide the tools panel.

Simulator

Home

Click the Home button, the Mini Program will go to background, which can be used to test onShow and onHide function in app.js or page.js.

Location

Click the Location button, you can mock the location of simulator. Then my.getLocation will return the mocked data.

Note:

Float data is required when inputting the longitude and latitude.

Simulator

Scan

Mock the my.scan API, you can input the scan result, then in Mini Program, my.scan will get the mocked data.

Shake

Simulate the shake of the device, used to test my.watchShake API.

Corp

Simulate the capture screen event of users, used to test my.onUserCaptureScreen API.

MemWarn

Simulate the memory warning event of app, used to test my.onMemoryWarning API.