Get Bluetooth MAC Address via adb [duplicate]

2019-02-06 04:38发布

This question already has an answer here:

Please help me to retrieve the Bluetooth MAC Address of my Galaxy S3 phone connected via USB port. My device is rooted.

4条回答
老娘就宠你
2楼-- · 2019-02-06 05:18

adb shell cat /sys/class/net/wlan0/address

查看更多
兄弟一词,经得起流年.
3楼-- · 2019-02-06 05:20

Running netcfg will show you all interfaces on the system along with their MAC addresses.

查看更多
可以哭但决不认输i
4楼-- · 2019-02-06 05:22

Isn't bluetooth MAC address available on every Android phone in Settings?

Currently I have 2 devices near:

On Samsung Galaxy S2 - Settings > About Phone > Status

On HTC Desire - Settings > About Phone > Hardware Information

(Bluetooth must be turned on)

查看更多
戒情不戒烟
5楼-- · 2019-02-06 05:23

I usually get the mac address of the WiFi interface of an Android device (that is connected to my PC through a USB port) by running these commands:

  1. Find the device name using:

    adb devices
    

    Results usually looks like:

    List of devices attached 
    4e7354af    device
    1f97033e    device
    

    In this case we have two devices connected 4e7354af and 1f97033e. Let's work on the first one: 4e7354af

  2. Get the mac address for the first device:

    adb -s 4e7354af shell ip addr show wlan0  | grep 'link/ether '| cut -d' ' -f6
    

    In previous line, we used the -s option with the adb commands to specify the serial number. Then shell indicate that is a linux command followed by the ip addr show wlan0 | grep 'link/ether '| cut -d' ' -f6 this command can also be used in Linux if its interface has the same name as wlan0.

I generally use this approach because I have many devices connected to my testing environment. Good luck guys.

查看更多
登录 后发表回答