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 Application Stack / User Interface Bash / Shell Scripts Commands and Packages Compilation Content Management System - CMS Core Kernel C Programs Development & Build Development Environment Setup Errors & Failures Flutter git Go Language Programs Hardware Platforms HTML JAVA Programs Kernel & Device Drivers Linux, OS Concepts and Networking Linux Device Drivers Linux Host, Ubuntu, SysAdmin Linux Kernel Linux Networking Middleware Libraries, HAL Monetization / Google AdSense Multimedia - Audio, Video, Images NDK / Middleware / HAL 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 User Interface Web design and development Wordpress Yocto / Bitbake / Openembedded

Leave a Reply / Ask Question