Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
ポート 8080 をリッスンしている Android エミュレーターで HTTP サーバーが動作しています。同じ PC のブラウザーから接続するにはどうすればよいですか? 127.0.0.1 を試してみましたが、接続できませんでした。
でポート転送を有効にする必要がありますadb。例えば:
adb
adb forward tcp:8080 tcp:8080
これにより、 localhost TCP/8080 への着信接続がエミュレーター TCP/8080 に転送されます。
参考はこちら。
10.0.2.2 を使用して実際のマシンにアクセスできます。これは、開発に役立つように設定されたエイリアスです。