Skip to content

Latest commit

History

History
73 lines (36 loc) 路 3.03 KB

Tutorial.md

File metadata and controls

73 lines (36 loc) 路 3.03 KB

Tutorial

How to get, setup and run gnimag

0. What do you need?

  1. You need a Mac: gnimag is written in Swift and does therefore only run on macOS. (gnimag uses Cocoa in some minor places. These places would have to be rewritten for Linux in order for gnimag to compile and run on Linux/Unix etc.).

  2. Xcode 12 needs to be installed on your Mac. You also need brew and make.

  3. With these prerequisuites, all you need is an Android smartphone (or Windows Phone) to get started. If you want to run gnimag on an iPhone, you need to build a tapping robot (there are some tutorials out there that build an Arduino-driven robot). This is because iPhones don't allow touch simulation via software.

1. Getting gnimag

  1. Download or clone this repository from GitHub.
  2. Select the folder in terminal and execute make.
  3. Wait a few minutes while make is building gnimag from source.

2. Setting up the enivronment

You need a program for mirroring your smartphone to your computer.

  • For Android devices, we recommend scrcpy.
  • For iPhones, we recommend AirServer. It is paid but has a free trial version. Free alternative: QuickTime Player.

After installing the screen mirroring program, connect your smartphone via cable to your Mac and start mirroring the screen.

  • On Android, make sure you have enabled adb debugging on your device.
  • For a more stable AirServer-iPhone connection:
    • Before starting AirServer, disable both iPhone's and Mac's WLAN and Bluetooth.
    • Plug your iPhone into your Mac. Create a personal hotspot on your iPhone and connect your Mac to this hotspot (inside the Mac's network settings).
    • This allows AirPlay transmission via cable rather than via WLAN.

3. Running gnimag

Which game do you want to play?

  • MrFlap: perform gnimag run mrflap.
  • ... TODO

After make has finished successfully, press play in MrFlap. Then start gnimag:

gnimag run mrflap -android
gnimag run mrflap -ios

See here (or run gnimag) for all supported games.


Stop gnimag by pressing alt+c in the Terminal.

Attention: While running gnimag, use your Mac as little as possible. gnimag takes plenty of resources as it continuously fetches new images from the screen mirroring application (at the Mac screen refresh rate) and analyzes them. In fact, closing, hiding or moving the screen mirroring application's window may adversely affect or stop gnimag.

Why is MrFlap crashing so early?

If you are using your Mac actively while gnimag is running, that is one reason.

Otherwise, you have the scrcpy window either too small (image analysis cannot produce sensible results) or too large (scrcpy is lagging, largely varying input+output delay).