ADB无法启动且常规方案无效——Debian Buster下Genymotion技术求助
Hey there, let's work through this frustrating ADB/Genymotion issue you're hitting with your CRNA app on Debian Buster. I've dealt with similar tool mismatches before, so let's go through some targeted checks that often fix this kind of problem:
Genymotion ships with its own ADB binary, and if it's out of sync with the one from your Android SDK, that's the #1 cause of these weird connection issues.
- First, check which ADB your system is using: run
which adband note the full path. - Open Genymotion, go to Settings > ADB. If it's set to "Use Genymotion's embedded ADB", switch it to "Use custom Android SDK tools" and point it directly to your SDK's
platform-toolsfolder (not just the root SDK directory—this is a common mistake!). - Verify versions match: Run
adb versionin your terminal, then navigate to Genymotion's embedded ADB path (usually/opt/genymotion/tools/adb) and run./adb version. They need to have the same major/minor version number. If not, either update your Android SDK platform-tools or stick with using your SDK's ADB in Genymotion.
Debian has strict device permissions, and even virtual Genymotion devices can hit roadblocks here.
- Create or edit the Android udev rules file:
sudo nano /etc/udev/rules.d/51-android.rules - Add this line (replace
<your-username>with your actual Debian login name):
(18d1 is Google's vendor ID, which covers Genymotion virtual devices)SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e42", MODE="0666", OWNER="<your-username>" - Reload udev rules and trigger changes:
sudo udevadm control --reload-rules && sudo udevadm trigger - Log out and back in—this ensures the new permissions apply to your user session.
CRNA sometimes uses a different ADB instance than the one you've configured in your shell.
- Run
npx react-native infoand look for the "ADB" entry—make sure it points to your Android SDK'splatform-tools/adb. - If it's wrong, hardcode the paths in your shell config (
.bashrcor.zshrc):export ANDROID_HOME=/path/to/your/android-sdk export PATH=$ANDROID_HOME/platform-tools:$PATH export PATH=$ANDROID_HOME/tools:$PATH - Source the config file:
source ~/.bashrc(or equivalent for your shell) and confirm withecho $PATHthatplatform-toolsappears early in the list.
Sometimes Genymotion gets stuck in a disconnected state even if ADB is running.
- Start your Genymotion virtual device, then click the small gear icon (device settings) > ADB > hit the "Refresh ADB" button.
- Alternatively, use the toolbar icon (looks like a phone with a USB cable) and select "Restart ADB connection".
Even adb kill-server can leave behind lingering processes or corrupted sockets.
- Kill all ADB-related processes:
sudo killall adb - Delete any stale ADB socket files in
/tmp:rm -f /tmp/adb* - Start ADB fresh:
adb start-server - Check if your device shows up:
adb devices—you should see your Genymotion device listed with a "device" status (not "unauthorized" or "offline").
Outdated versions are a common hidden culprit:
- Update Genymotion to the latest Debian-compatible version (you can grab it from their official download page).
- Open the Android SDK Manager and update platform-tools, build-tools, and the SDK platform matching your Genymotion device's Android version.
If none of these work, try creating a brand new Genymotion virtual device with the same Android version your app targets—sometimes existing devices get corrupted ADB configurations that are hard to fix.
内容的提问来源于stack exchange,提问作者Robbie Milejczak

