参考
https://stackoverflow.com/questions/62468046/android-studio-launch-emulator-avd-unable-to-locate-adb
我的情况
1》已正确安装 Android studio
2》安装过程中没有安装SDK, JDK等
3》安装完成后我才指定我已独立安装好的SDK, JDK路径
4》我项目工程没有报错
7》SDK Tools里,我已正确安装
[ ] Android Emulator
[ ] Android SDK Platform-Tools
[ ] Google USB Driver
[ ] Inter x86 Emulator Accelerator (HAXM installer)
6》问题是:打开AVD时提示 unable to locate adb
解决办法
随便建立或打开一个android项目,
打开这个项目src
目录下的一个.java源文件,
鼠标在代码中随便点几下, 就会出现一个电灯泡 (要是出现又消失了就按Alt+Enter),
点击这个电灯泡, 它会提示你 Setup SDK
, 然后你点击它,
会弹出一个框, 选择Android Platform API
(或者叫Android API X for Platform
),
点击安装即可。
后续问题
上面的问题解决了,我的AVD还是不能启动,启动时提示:
The emulator process for AVD 5.1_WVGA_API_19 was killed.
底部 event log 框提示错误:
Emulator: emulator: ERROR: This AVD's configuration is missing a kernel file! Please ensure the file "kernel-ranchu" is in the same location as your system image.
Emulator: emulator: ERROR: ANDROID_SDK_ROOT is undefined
Emulator: Process finished with exit code 1