DEV Community

Okinea Dev
Okinea Dev

Posted on • Originally published at okineadev.Medium on

How to get a free macOS machine for testing?

image
Photo by Tianyi Ma on Unsplash

It happens that you have created a program and want to test it on different operating systems (including macOS ), but if you do not have a Macbook, you can ask a friend to test your program, but what if he also does not have a Macbook?

How then to test the program on macOS anyway??

There is a solution! — you can use the runners that GitHub provides for free for open source projects, on which you can run a script or whatever

First of all, remember these simple rules:

  • Don’t abuse virtual machines (abuse of free services is bad.)
  • Do not use them for illegal purposes and for DDoS attacks

If you agree to the rules, here’s a step-by-step guide:

1. First of all, you need to create a separate public repository for testing (github.com/new)

Screenshot of creating a public repository on GitHub

2. Create a workflow in _.github/workflows/macos-runner.yml_ with the following content:

name: macOS Runner

# Controls when the workflow will run
on:
  workflow_dispatch:

jobs:
  test:
    # The type of runner that the job will run on
    # See https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners#standard-github-hosted-runners-for-public-repositories
    runs-on: macos-13

    # Steps represent a sequence of tasks that will be executed as part of the job
    steps:
      - name: Setup tmate session
        uses: mxschmitt/action-tmate@v3

Enter fullscreen mode Exit fullscreen mode

3. Go to the “ Actions ” tab

Screenshot of “Actions” tab

4. Then click on the “Run workflow” button:

image

5. Now after launch, in the logs you will be given a link and ways to connect via ssh

GitHub Runner logs

Done! 🎉

Now you can debug your application in macOS or any other environment!

Original page source: https://gist.github.com/okineadev/b80d7f9a065543655e203471d582f3f1

Top comments (0)