When you follow the above answer https://stackoverflow.com/a/10236938/6117565, you might get the error "No route to host".
To fix that, before step 5 in the above answer, first, start your emulator then try the connecting device. Don't know what is happening but this trick works.