Saya sarankan Anda menggunakan PowerShell
Setel Terminal Android Studio ke PowerShell:
Settings > Tools > Terminal > Shell path = pwsh.exe (instead of cmd.exe)
Buka Terminal di Android Studio
PowerShell 7.0.1
Copyright (c) Microsoft Corporation. All rights reserved.
https://aka.ms/powershell
Type 'help' to get help.
PS >
Uji jalur untuk adb.exe
# `pikachu` should be replace your username
PS > test-path "C:\Users\pikachu\AppData\Local\Android\sdk\platform-tools"
True
Buka file profil PowerShell Anda di editor teks Anda
PS > notepad $profile
tambahkan di bawah garis, simpan dan keluar
# `pikachu` should be replaced with your username
$env:PATH+="C:\Users\pikachu\AppData\Local\Android\sdk\platform-tools"
buka kembali Terminal dan coba adb
PS > adb
Android Debug Bridge version 1.0.41
Version 30.0.1-6435776
Installed as C:\Users\hdformat\AppData\Local\Android\sdk\platform-tools\adb.exe
global options:
-a listen on all network interfaces, not just localhost
-d use USB device (error if multiple devices connected)
-e use TCP/IP device (error if multiple TCP/IP devices available)
-s SERIAL use device with given serial (overrides $ANDROID_SERIAL)
-t ID use device with given transport id
-H name of adb server host [default=localhost]
-P port of adb server [default=5037]