def get_adb_path():
        """
        Returns the path to the adb executable.

        Checks if adb process is running, returns the running process path.

        If adb process is not running, checks if ANDROID_HOME environment variable is set.
        Constructs the adb path using ANDROID_HOME and returns it if set.

        If adb process is not running and ANDROID_HOME is not set, uses built-in adb path.

        Returns:
            str: The path to the adb executable.
        """
        if platform.system() == "Windows":
            ADB_NAME = "adb.exe"
        else:
            ADB_NAME = "adb"

        # Check if adb process is already running
        try:
            for process in psutil.process_iter(['name', 'exe']):
                if process.info['name'] == ADB_NAME and process.info['exe'] and os.path.exists(process.info['exe']):
                    return process.info['exe']
        except:
            # maybe OSError
            pass

        # Check if ANDROID_HOME environment variable exists
        android_home = os.environ.get('ANDROID_HOME')
        if android_home:
            adb_path = os.path.join(android_home, 'platform-tools', ADB_NAME)
            if os.path.exists(adb_path):
                return adb_path

        # Use airtest builtin adb path
        builtin_adb_path = ADB.builtin_adb_path()
        return builtin_adb_path

        Returns the path to the adb executable.

        Checks if adb process is running, returns the running process path.

        If adb process is not running, checks if ANDROID_HOME environment variable is set.
        Constructs the adb path using ANDROID_HOME and returns it if set.

        If adb process is not running and ANDROID_HOME is not set, uses built-in adb path.

        Returns:
            str: The path to the adb executable.
        
airtest/core/android/adb.py