I need to fetch the IPaddress assigned by the operator after a successful 3G or LTE data call.
$adb shell netcfg >> doesnt have the assigned IP address.
I tried adb shell dumpsys
and grep ip address, but in vain. Any help/pointers?
I need to fetch the IPaddress assigned by the operator after a successful 3G or LTE data call.
$adb shell netcfg >> doesnt have the assigned IP address.
I tried adb shell dumpsys
and grep ip address, but in vain. Any help/pointers?
Try this command, it will help you to get ipaddress
tiwlan0 is the name of the wi-fi network interface on the device. This is generic command for getting ipaddress,
It will output like this
According to comments: netcfg was removed in Android 6
Try
Or
adb shell ip addr > ippdetails.txt This will get all list of ip's assigned to devices.
Try:
It will return something like that:
This part is your IPV4 assigned by the operator
This part is your IPV6 assigned by the operator
Try:
It will return your IPV4 assigned by the operator
Try this command for Version <= Marshmallow,
24: wlan0: mtu 1500 qdisc mq state UP qlen 1000 link/ether ac:c1:ee:6b:22:f1 brd ff:ff:ff:ff:ff:ff inet 192.168.0.18/24 brd 192.168.0.255 scope global wlan0 valid_lft forever preferred_lft forever inet6 fd01::1d45:6b7a:a3b:5f4d/64 scope global temporary dynamic valid_lft 287sec preferred_lft 287sec inet6 fd01::aec1:eeff:fe6b:22f1/64 scope global dynamic valid_lft 287sec preferred_lft 287sec inet6 fe80::aec1:eeff:fe6b:22f1/64 scope link valid_lft forever preferred_lft forever
To connect to your device run this
connected to 192.168.0.18:5555
Make sure you have adb inside this location android-sdk\platform-tools