Miva Merchant, eCommerce, SEO, Wordpress, & general web development and consultation.
Android

Edit your android hosts file the easy way.


I needed to edit the hosts file on my Nexus 5 so I could test a non-existent domain I use for development. The problem? File permissions. The solution? A free hosts editor app.

by

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. 

  1. go to the Chainfire main page
  2. find your phone
  3. click on the download link
  4. towards the bottom of the next screen, click on the filename to download
  5. connected your phone to your computer (USB for windows)
  6. 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!

(0/5, vote) my rating:
overall rating:

Please log in to leave a comment.

The blog posts on Scot's Scripts are served by Scot's Blogger, a Miva Merchant blogging module that makes it easy to create a Wordpress style blog, rich content, and extra pages in your Miva Merchant store.