This is going to be a short article because editing your hosts file on an Android device such as LG's Nexus 5 (rock solid awesome smart phone) is super quick and super easy. No ADB, no manual file permissions, nothing difficult.
The only requirement: your device must be rooted.*
Step 1 to editing your Android hosts file: install an app called Hosts Editor by Nilhcem.
Step 2: Open the app and update your Android hosts file.
In my case I needed to spoof my dev site, scotsscripts.smr.com, and once I added the IP address and the domain into the hosts list, it worked. No fuss, no mess, no hassle, it just plain worked.
*How to root your Android device: I used Chainfire's one-click rooting utility with great success.
- go to the Chainfire main page
- find your phone
- click on the download link
- towards the bottom of the next screen, click on the filename to download
- connected your phone to your computer (USB for windows)
- unzip the file and then run the batch/sh file for your OS
For windows, I ran root-windows.bat
and moments later my phone was rooted. This method is much easier than going into ADB and doing everything by hand.
Note: you are responsible for anything that happens to your phone. I had good results with Chainfire but there is no guarantee anyone else will. Always back up your phone before doing ANYTHING like this!