baretd
baretd

Reputation: 21

Android : how to bind computer network to smartphone network for development on physical device

I would like to bind my computer's network to my smartphone's (physical) network when I debug on the latter.

This is done automatically on virtual devices but not when debugging on a physical device.

I can access services (api | via ip 10.0.2.2) on my local machine but I can't get onto the internet.

I've found adb commands but they don't work.

Upvotes: 0

Views: 80

Answers (1)

Viewed
Viewed

Reputation: 1413

If computer and smartphone in one network via router you can use wireless connection with adb.

Go to smartphone settings, find dev options, enable usb debug. Then find wireless debug option (android 11+). Use adb pair *ip:port* with ip and port from screen, then adb connect *ip:port* in Android Studio terminal. For older android like 8 version possible also but more complicated (for example post).

Upvotes: 0

Related Questions