简体   繁体   中英

How to reach the localhost of a unity game from android emulator

I'm developing a game using Unity3d and I'm facing a problem. The game which is written in C# has a database that linked using PHP (XAMMP)..

But the issue: I tried to post my Ip address instead of Localhost in c# script but still I can't connect the db,,

I used both: "http:MY_PC_IP:8080/insertuser.php"; and: "http:MY_PC_IP/insertuser.php"; I'm using Nox as an emulator..

使用内部IP地址10.0.2.2

You need to use following command:

adb reverse tcp:8080 tcp:8080

And instead of using ip address use localhost

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