zepp-health / zeppos-samples

A collection of samples about Zepp OS watchfaces and applications
Apache License 2.0
153 stars 55 forks source link

MacOS Developer Environment Set Up #18

Open pchinjr opened 2 years ago

pchinjr commented 2 years ago

Hi, really excited to develop some apps for my GTR 3 Pro! I'm on macOS Monterey V 12.5.1

Following the instructions found here https://docs.zepp.com/docs/guides/tools/simulator/setup/#install, I downloaded the environment setup script, but it seems like this is meant for running in Linux. When I run the script on my Mac, I get the error ./setup.sh: line 40: /etc/os-release: No such file or directory.

Looking at the script, it's checking for files and structures used in a Linux distro, like running apt get. I've downloaded the simulator DMG file and installed it on my Mac.

When I try to connect to the simulator, I get the following error: [firmware_simulator]: sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper sudo: a password is required.

Finally, when I try to run start_qemu.sh from the Application folder, I get the error Current path : "/Applications/simulator.app/Contents/Resources/firmware" firmware path: "fw/main.elf storage path: "fw/norflash.bin File fw/main.elf or fw/norflash.bin not found! which also leads me to believe I'm not in the correct environment. I guess my main question is, do I have to have a full Linux environment to run the simulator? Really appreciate any help you can give me to get my environment running on macOS.

pchinjr commented 2 years ago

I got my simulator running, but it's not according to any directions in the docs. For macOS, this is what I did:

  1. brew install --cask tunnelblick
  2. Configure Virtual network card, had to do it twice, uninstall and reinstall tun and tap system extensions
  3. verified virtual network card ls /dev
  4. Downloaded and installed simulator DMG 1.1.6 for Mac
  5. open a terminal and run cd /Applications/simulator.app/Contents/MacOS && sudo -s ./simulator
  6. Open Zepp Studio in a browser
  7. click the red circle icon to connect the simulator
  8. click the green play button to start the simulator
  9. wait for the simulator app to open
  10. read the console for warnings and try again if it fails
  11. eventually a preview window will open

I'm not quite sure exactly what series of steps made it all work, because I tried everything I could think of. Knowing that there's a command line invoke of ./simulator as well as clicking simulator in the Simulator GUI app, as well as hitting simulator in the Studio Web App.

In the future, I will try to have a full local workflow with just vscode and not have to go through zepp studio.

Any suggestions on making the environment easier to work with?

mrcoon commented 2 years ago

@pchinjr We are glad that you have successfully installed the Zepp Mini Program development environment.

The emulator currently relies on a virtual NIC and requires administrator privileges. This makes the installation process cumbersome and we are working on fixing this, but it is a long term plan.

Alternatively, if you want to use a local IDE, you can try using the CLI tool

emircanerkul commented 1 year ago

@mrcoon I have a different problem but couldn't find the solution yet. Seems Zepp Studio deprecated

image