XMRig on Google Pixel & Other Androids


We have successfully managed to run Monero Ocena's XMRig on our old Google Pixel 3a, Google Pixel, Google Pixel 3, and LG V40 ThinQ. While really more of PoC, it should be noted that roughly ~10 Google Pixel 2+ will equate to nearly $1.00 XMR per day. This has great implications as people can begin to farm using old and used cell phones. All proved to be succesful. Our team is now contributing to Monero Ocean with over 10 phones. The energy savings is abundant and this is a great PoC. Also, using an NTONPOWER charging station, 10 phones running at rougly 900H/s-1600H/s on 100w, can give a maximum of 10Kh/s with very little energy requried. This has far reaching implications for power savings and XMR mining capabilities with xmrig-mo.

Below are the instructions on how to get XMRig-mo up and running on Android phones. We have successfully compiled hwloc to be used in xmrig's implementation. For comparison the average Google Pixel 2 XL equats to nearly 550 H/s or .55 Kh/s. That's not bad and would be usefully for industries with a lot of old and semi-broken phones laying around. We are publishing this as a PoC and also to get more people mining XMR and on Monero Ocean to spread the distribution around. Below are the instructions to mine XMR using XMRig-mo on your Android phone.

Phones Tested

Google Pixel (Original), Google Pixel 3a, Google Pixel 2 XL, Google Pixel 3,  Google Pixel C, HiSense Smart HD TV, LG V40 ThinQ, Huawei P30, Samsung A31. 

Thanks to @TYU1996  and all others that cotinue to test new devices with xmrig-mo. 

You can find the phone specific config.json files at the github at the bottom of the page. (sieve-rig)

Instructions

1. Download termux. It is recommended that you downloads our APK of termux which is optimized for XMRig. It has been digitally signed with the Monerado keystore.  You can't find that at the following link: 

https://github.com/Zetakov/termux-app/releases/tag/v0.117-zetakov

(you can read what we've changed at the bottom of this section)

1.1. Make sure termux repository is set to a correct one, i.e., termux-change-repo (grimler)

 1.2. Give storage permissions to termux (App info->permissions)

 1.3. Connect a bluetooth keyboard

IMPORTANT UPDATE

We have wrote an install script that will do all the following instuctions for you below. 

androidxmrig.sh

You can find this script to run in your termux at: https://github.com/zetakov/sieve-rig

Copy androidxmrig.sh andt run the following, in termux, on your phone:

$ chmod +x androidxmrig.sh && ./androidxmrig.sh

And follow the insturctions on the screen. 

 -------In Termux---

 2. apt-get install autoconf automake cmake git libtool -y

3. mkdir builds

4. cd builds 

5. git clone https://github.com/protomens/hwloc 

6. cd hwloc 

7. ./autogen.sh && ./configure && make 

8. cd .. 

9. git clone https://github.com/protomens/xmrig 

10. cd xmrig 

11. mkdir build 

12. cd build 

13. cmake .. -DHWLOC_INCLUDE_DIR=/data/data/com.termux/files/home/builds/hwloc/include -DHWLOC_LIBRARY=/data/data/com.termux/files/home/builds/hwloc/hwloc/.libs/libhwloc.so 

14. make

 -------Settings--------- 

15. Turn on Developer Options (7 clicks on Build Number in Settings) 

16. Go to Developer Settings 

17. Turn on 'Stay Awake' and 'USB Debugging'

 ----------Termux------ 

18. Run xmrig

 --------------------------- 

19. Plug phone in and find a suitable config.json file as mentioned below

20. Profit

Termux-zetakov & Sieve-rig

As we mentioned above, we have changed a minor part of termux-app to be optimized for an xmrig instance. The unaltered version of termux will give you daily issues of segmentation faults due to over allocation of memory heaps. This is because it cannot handle huge pages which require 2GB or more on a phone and when xmrig tries to allocate this much memory a core is dumped by termux. We have modified termux-app's main repository to allow for large heaps thereby preventing segmentation faults on the beginning benchmarking and mining thereafter. 

We strongly recommend using the termux_v0.117-zetakov version as this will prevent daily restarting of xmrig that we've expereienced thus far.  You can find termux_v0.117-zetakov here

Finally, we come to sieve-rig which is really just xmrig with configuration files for specific kinds of Android devices and a few bash scripts to ease things up a bit. Basically, these config.json files are optimized for specific Android devices, mainly the Google Pixel as we have purchased a large number of them for our mini Android mining farm. You can find the addendum to xmrig (sieve-rig) here