skip to Main Content

I currently have an old Mac and a Windows desktop. I prefer to develop and write code on my Windows machine because it’s much faster than my 8GB RAM Mac.

My current setup is to share the project folder over my local network. I access it from my Mac to run the project.

The problem is that they overwrite each other when I run pub get or build. Is there a way I can develop on Windows and use hot reload/hot restart on the Mac?

Using Git is one option, but it feels like overkill if I have to commit a small change just to hot reload.

2

Answers


  1. Chosen as BEST ANSWER

    Thanks to @Brad suggestions, I set up rsync on windows and ssh in my mac. Step by step instructions below:

    1. Install an SSH Server on Your Mac (if it’s not already enabled):
    • Open System Preferences > Sharing.
    • Check Remote Login to enable SSH access.
    • Add the path you want to share to windows here.
    • Note your Mac’s IP address or hostname shown here (you’ll need it for destination in the script).
    1. Install rync
    2. Create rsync script in Windows. My final script looks something like this.

    #!/bin/bash
    
    # Define source and destination paths
    SOURCE="/c/path/to/windowsdev/"  # Adjust this path to your specific source folder on Windows
    DESTINATION="user@host:/path/to/macdev/"  # Use your Mac's username and host, and the correct path
    
    # Run rsync to sync changes, excluding specific directories
    rsync -avz --delete 
    --exclude '.idea/' 
    --exclude '.dart_tool/' 
    --exclude 'build/' 
    "$SOURCE" "$DESTINATION"


  2. Why dont you just execute hot reload, hot restart or even build your projects in windows if your windows have better specifications?

    Also, what do you mean by overwrite each other, maybe you can explain more?

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search