Home/Q&A/My code is on Windows. How do I get it onto a remote Mac to compile?

My code is on Windows. How do I get it onto a remote Mac to compile?

Updated · airankrush

Direct answer

Use Git. Push the code from Windows to your Git repository and pull it on the remote Mac; sync every later change the same way. A zip archive sent through the remote-control client's file transfer only suits small one-off files.

Basis

  • You do not need to install Git separately on the remote Mac. According to Apple's documentation, the first time you run a command such as git in Terminal on a fresh macOS install, the system prompts you to download and install the Xcode Command Line Tools; a full Xcode install also includes it.
  • There are two common kinds of credentials for pulling a private repository: HTTPS with an access token, or generating a new key pair on the remote Mac with ssh-keygen and adding the public key to the repository's deploy keys. Both are outbound connections from the Mac and do not require changing the machine's network configuration. Grant read-only or single-repository access only, and do not copy the private key from your main computer onto it.
  • Projects that come from Windows have two common pitfalls. One is line endings: a script file that carries Windows line endings fails when run on macOS; you can set eol=lf for *.sh in the repository's .gitattributes. The other is the executable bit: Windows does not record this attribute, so you need git update-index --chmod=+x to add it to scripts. For exact syntax, follow the official Git documentation.
  • Do not pack up and send directories such as node_modules, Pods and build. They contain content compiled per platform; reinstalling dependencies on the Mac is the correct approach.

Information as of .

Boundaries: when the answer is different

If your company's code repository only allows access from fixed addresses, this route may not work: our machines use US residential broadband, the public exit may be shared with other machines, and it is not a fixed address. In that case find out your company's rules first. Whether the UU Remote and RustDesk clients support file transfer, and whether there is a size limit, depends on the current client version. We do not provide a way to log in to this machine's terminal from the public internet.

How to do it

  1. On Windows, confirm that .gitignore excludes dependency and build directories, then commit and push.
  2. Connect to the remote Mac, open Terminal and run git --version, then follow the prompt to install the Command Line Tools.
  3. Set up an access token or deploy key and git clone the repository.
  4. Install dependencies on the Mac, for example pod install or flutter pub get, then open the project and compile.
  5. Commit any changes you made on the Mac to get it compiling and push them back to the repository, then pull on the Windows side so both stay in sync.

Use case

This question belongs to the use case: iOS without a Mac: a remote Mac mini can build, sign and upload, but not debug on a real device

Other questions in the same use case:

Pricing and availability: see the plans page · Help center (中文) · Refund policy (中文) · Telegram Contact support

Back to home · All Q&A