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
 $ adb shell getprop ro.product.model
Nokia 7 plus 
 $ adb shell getprop ro.product.manufacturer
HMD Global 
 $ adb shell getprop ro.serialno

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 Content Management System - CMS Core Kernel C Programs Development Environment Setup Errors & Failures File Systems git Go Language Programs Hardware Platforms Home HTML 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 Programming Languages RaspberryPi Scripting and Automation Search Engine Optimisation ( SEO ) Social Media Socurce Code Management ( SCM ) System Administration, Security Testing and Debugging Uncategorized Userspace Utilities Web design and development Wordpress Yocto / Bitbake / Openembedded

Leave a Reply