歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux教程 >> Android模擬器將本地PC機當服務器

Android模擬器將本地PC機當服務器

日期:2017/2/28 15:54:46   编辑:Linux教程

Referring to localhost from the emulated environment

If you need to refer to your host computer's localhost, such as when you want the emulator client to contact a server running on the same host, use the alias 10.0.2.2 to refer to the host computer's loopback interface. From the emulator's perspective, localhost (127.0.0.1) refers to its own loopback interface.

本地調試時,在模擬器上可以使用 10.0.2.2 ,這個地址對應PC機的 127.0.0.1 , 本人親自驗證,有效。

Copyright © Linux教程網 All Rights Reserved