Android Studio无设备列表,运行未询问设备选择且配置菜单报错
Hey, I’ve dealt with almost identical issues in Android Studio before—let’s break this down into fixable steps:
1. Fixing the "Auto-runs on Emulator, Ignores Physical Device" Issue
First, let’s make sure your physical device is being recognized properly, then adjust the run settings to let you choose where to deploy:
Enable full USB debugging on your device
- Unlock Developer Options by tapping your device’s Build Number 7 times (found in Settings > About Phone).
- Go to Developer Options and check:
- USB Debugging
- USB Installation (allows installing apps via USB)
- Some devices also require USB Debugging (Security Settings) to grant installation permissions.
Verify device recognition in Android Studio
- Check the device dropdown menu in the top-right corner of AS (next to the Run button). If your physical device isn’t listed:
- Unplug and re-plug the USB cable, or try a different USB port (avoid USB 3.0 ports if possible—they can cause compatibility glitches).
- Restart the ADB server via Terminal in AS:
adb kill-server adb start-server - Sync your project with Gradle: Go to File > Sync Project with Gradle Files.
- Check the device dropdown menu in the top-right corner of AS (next to the Run button). If your physical device isn’t listed:
Force Android Studio to ask for a deployment target
- Click the run button’s dropdown menu and select Edit Configurations...
- In the window that pops up, select your app’s configuration, then go to the General tab.
- Under Deployment Target Options, set the target selection to Open Select Deployment Target Dialog (instead of auto-selecting the emulator).
- Hit Apply > OK, then try running your app again—you should see a prompt to choose between your emulator and physical device.
If accessing the configuration menu throws errors, this is usually tied to corrupted caches or misconfigured Gradle files:
Clear Android Studio’s cache
- The quickest way is to use AS’s built-in tool: Go to File > Invalidate Caches..., check Invalidate and Restart, and let AS reboot. This clears corrupted cache files that often cause menu glitches.
- If that doesn’t work, manually delete the cache directory:
- Windows:
C:\Users\<Your Username>\.AndroidStudio<Version>\system\caches - Mac:
~/Library/Caches/Google/AndroidStudio<Version>
- Windows:
Fix Gradle configuration issues
- Open your project’s root-level
build.gradlefile and ensure the Android Gradle Plugin version matches your AS version (e.g., AS Hedgehog requires plugin version 8.2+, Gradle version 8.3+). - Delete the
.gradlefolder (both in your project root and your user directory), then sync the project again via File > Sync Project with Gradle Files. This rebuilds the Gradle configuration from scratch.
- Open your project’s root-level
Recreate corrupted run configurations
- If the existing run config is broken, delete it: In Edit Configurations..., select your app config, click the minus icon to remove it.
- Click the plus icon, choose Android App, and set up the configuration with default settings. Save it, then try accessing the menu again.
内容的提问来源于stack exchange,提问作者Elton_Setan
相关产品推荐
相关产品推荐

