简体   繁体   中英

Android Virtual Device: Accessing NanoHTTPD from hostsystem

I used NanoHTTPD for my android application.

During the development I am running the app on an AVD. Is there a way to accessing the web service from my host system? What´s the IP address of the AVD?

Use adb forward .

For example, if your NanoHTTPD listens to port 80 on AVD, run

adb forward tcp:20001 tcp:80

then you can connect to localhost:20001 on the host machine to access the server.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM