Press "Enter" to skip to content

How to transform an Android device into a cryptocurrency mining machine

Last updated on 14/01/2024

We will target the Monero (XMR) cryptocurrency, which has some advantages for casual miners, such as the possibility of mining without the need for expensive mining rigs. More info on the web and the official webpage.

As a start, you need a Linux terminal running in your Android device. Termux is an open source Linux terminal emulator for Android. Although it is still available from Google Play, Google does not allow updates anymore. The recommended ways to install Termux is via Github or F-Droid. I personally used the F-droid way, and it worked just fine. Once Termux is installed in the Android device, enter the following commands:

apt update

apt upgrade

Next, grant Termux access to the internal storage, which is needed for packaging installation:

  • termux-setup-storage

A popup window will ask if you want to grant permission to access the internal storage. Once, you confirm, the command “ls” (i.e. lower case for “LS”) will show the content of the current directory.

  • cd storage
  • ls

Next, install git, build-essential, and cmake packages, using the following command:

  • pkg install git build-essential cmake -y

Let’s install xmrig from github:

  • git clone https://github.com/xmrig/xmrig.git

Now, let’s upgrade the packages to their latest version, if any:

  • apt upgrade

Move on with these self-explaining commands:

  • cd xmrig
  • mkdir build
  • cd build

Now, let’s run cmake:

  • cmake .. -DWITH_HWLOC=OFF

Next, let’s run make:

  • make -j10

The building process will build the target xmrig. Once you see the message “Built target xmrig”, your system is ready for mining.

You need to create a digital wallet to store and manage your cryptocurrency. Visit https://www.getmonero.org/downloads/ and download the Monero GUI Wallet. Take note of your XMR wallet address, which is a long alphanumeric string, something like: 42hM8vERnBG68HTYExw4LC7kV3MNC7BTYQQLg9G59VuV7mDtNP1ocmULWrvj5AQLHSRm7ygg2Qwf1i2UhSqasf59PDHAqua

Next, you have to join a mining pool. You can visit https://miningpoolstats.stream/monero and select the pool you prefer. If you want to follow the philosophy behind Monero, you should avoid the largest pools, to help Monero remain decentralized.

You can start the mining process from the Termux terminal by typing:

./xmrig -o [pool_address]:[port] -u [XMR wallet] -p [device_name]

Where:

  • [pool_address]: is the web address of the mining pool you are joining
  • [port]: is the port, if any, recommended  by the mining pool you selected
  • [XMR wallet]: is the string which identifies your XMR wallet
  • [device_name]: is the optional name you can assign to your mining device; this is useful if more than one device is mining XMR into your wallet.

At this point your device is running and contributing to XMR mining.

A 2018 Samsung Galaxy Note 9, fully functional but with a heavily damaged display, turned into a mining machine. Its 8 cores are capable of an average of 250-600 H/s.

Be First to Comment

Leave a Reply

Your email address will not be published. Required fields are marked *