Identify android device information WiFi Mac Address , Product Model, Serial Number using adb

 $ sudo adb devices
List of devices attached
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
B2NGAA8831702707	device
 $ adb shell cat /sys/class/net/wlan0/address
6c:c4:d5:6f:84:dc 
 $ adb shell getprop ro.product.model
Nokia 7 plus 
 $ adb shell getprop ro.product.manufacturer
HMD Global 
 $ adb shell getprop ro.serialno
B2NGAA8831702707 

Example shell script to extract device mac address using adb,

get_device_mac() {
    echo -n "getting device mac is ....."
    $ADB_PATH shell cat /sys/class/net/wlan0/address
    DEV_MAC=`$ADB_PATH shell cat /sys/class/net/wlan0/address`
    DEV_MAC=$(echo $DEV_MAC|tr -d '\n'|tr -d '\r') #cleaup \r \n output from adb
    echo "$DEV_MAC"
}
Android Android Commands Android Java Applications Application Libraries Bash / Shell Scripts Bluetooth driver Build Frameworks Commands and Packages Core Kernel C Programs Development Environment Setup Documents / Books Errors & Failures File Systems Framebuffer / Display Driver git Go Language Programs Hardware Platforms Home JAVA Programs Kernel & Device Drivers Kernel Booting and Porting Linux, OS Concepts and Networking Linux Device Drivers Linux Host, Ubuntu, SysAdmin Linux Kernel Linux Networking Middleware Libraries, HAL NDK / Middleware / HAL Network Driver OS Concepts PHP Procfs Filesystem Programming Languages RaspberryPi Scripting and Automation Search Engine Optimisation ( SEO ) Socurce Code Management ( SCM ) System Administration, Security Testing and Debugging Uncategorized Userspace Utilities Web design and development Wordpress Yocto / Bitbake / Openembedded

Leave a Reply