Recent developments in virtualization, emulation and techniques that allow running of applications developed for “foreign” platforms as if they were native ones, have made it relatively easy, and often free, to use the same app in mixed environments. This post takes a closer look on one of this techniques, namely Wine (acronym for “Wine Is Not an Emulator”), that allows running native Windows software on POSIX-compliant operating systems, such as Linux, macOS, & BSD, without need for a Windows license. Here we install the game on macOS Sierra / High Sierra (the screenshots are from Sierra). First you need to allow your system to install apps from “App Store and identified developers” (or possibly “Anyone”, depending on what else needs to be installed other than XQuartz and Wine).
Earlier macOS versions let you alter the default setting (that allows apps only from the App Store) by setting the Gatekeeper option under System Preferences Security & Privacy General, but High Sierra hides the other two options and you need to enable them by opening the Terminal (in Finder, click Go Utilities and open Terminal), and type the following (you need to enter your user password to be able to change the setting): sudo spctl -master-disable. After this you can go and change the Gatekeeper setting.
Windows' built-in command line programs aren't that great on their own. To make them better, we like to use third-party terminal programs, our favorite being the customizable and free Console.
After the installation is complete, you can go to and download the latest version of Four Winds Mah Jong. Once downloaded, click the executable setup package (normally 4W2Full24.exe) in Downloads. It will automatically be launched in Wine and installed in correct location. A Windows shortcut is placed on the desktop, but it naturally does not work. You need to replace it with a Mac alias.
Open your Home folder (in Finder, click Go Home or press Cmd+Shift+H). Now make hidden files and folders visible by pressing Cmd+Shift+.
This shows the hidden.wine folder where your Windows environment is installed. You may also need to Bypass DirectX sound (under the same option page), and choose a MIDI file (on the Themes option page) for the “Background” and “Win of the game” music, or set their values to “none”.
![Open Open](/uploads/1/2/5/4/125467816/199606280.png)
(the default music comes as.mp3 files which require DirectX). If you do not change the sound settings, you can turn off background music from the Options menu so that an unsupported feature is not used. If you have a one-button mouse, click the Game Controls button, then change the mouse control setting for discarding from “Right click on raised tile” to “Click on raised tile”. On the same dialog box, you may need to uncheck Use custom cursors (with recent Wine builds, animated and custom cursors seem to be working fine, but if the game suddenly freezes, one possible cause is the use of custom mouse cursors).
Close the Preferences dialog box and click Help Register to enter your registration name and number. Then choose Game New Game to start a new game with preferred rules. You may want to test with different game boards by using the options under the View Game boards sub menu to find the board size and layout that works best on your screen. Note that the quality of graphics is mediocre compared to the original but looks slightly better on boards that have not been scaled.
If you choose a 24-bit theme, scaling has a better quality: e.g., for the default graphics, choose File Preferences, then under User Interface Themes, choose “Four Winds (24-bit)”. And there you are, running Four Winds Mah Jong on your Mac, without needing a Windows license. The quality is not as good as when using VMWare or VirtualBox (both free), or Parallels Desktop, not to mention running the game on real Windows on a BootCamp partition, but at least you can now play proper Mahjong with multitude of rule options offline on your Mac. Running Four Winds on Linux The procedure is basically the same as on macOS, though installation happens from within the Terminal. WineHQ has instructions for installing Wine on several different Linux systems. Below is a screenshot of Four Winds running on Ubuntu 16.04 using Wine 3.0.
I assume that you have built your project and just need to launch it, but you don't have any AVDs created and have to use command line for all the actions. You have to do the following. Create a new virtual device (AVD) for the platform you need. If you have to use command line for creating your AVD, you can call android create avd -n -t where targetID is the API level you need. If you can use GUI, just type in android avd and it will launch the manager, where you can do the same. You can read more about. Run the AVD either by using command emulator -avd or through previously launched GUI.
Wait until the emulator fully loads, it takes some time. You can read about. Now you have to install the application to your AVD. Usually during development you just use the same Ant script you used to build the project, just select install target. However, you can install the application manually using command adb install. Now switch to emulator and launch your application like on any normal device, through the launcher. Or, as an alternative, you can use the following command: adb shell am start -a android.intent.action.MAIN -n /.
For example: adb shell am start -a android.intent.action.MAIN -n org.sample.helloworld/org.sample.helloworld.HelloWorld. As a commenter suggested, you can also replace org.sample.helloworld.HelloWorld in the line above with just.HelloWorld, and it will work too. If you have Git Bash you can open your emulator with a double-click, with some initial setup (tested in Windows 10 only):. Open Git Bash. Run cd /AppData/Local/Android/sdk/emulator. Run./emulator -list-avds and keep note of the emulator's name. MYEMULATOR for example.
Open Notepad and add these two lines (insert your emulator's name instead of MYEMULATOR): cd /AppData/Local/Android/sdk/emulator./emulator -avd MYEMULATOR. Save the file somewhere convinient as myfile. You can change 'myfile' as suits you best, but the extension.sh is needed. Open Git Bash at the directory where you stored myfile.sh and run chmod +x myfile.sh.
Remember to put your file's name instead of myfile. And that's it! From now on, everytime you need to start that emulator, just locate your myfile.sh and double click on it and wait for your Android emulator to launch!