A few of the environment quirks that come up repeatedly in Android development: juggling JDK versions, getting ADB to talk to a device over WiFi instead of a cable, and building release APKs without recreating the signing setup from memory each time.
Java version management with jenv
Android tooling is picky about JDK version, and juggling that against whatever else needs a different JDK is easier with jenv than with manually edited JAVA_HOME exports:
1
2
brew install openjdk@11
brew install jenv
1
2
3
# ~/.zshrc or ~/.bashrcexport PATH="$HOME/.jenv/bin:$PATH"eval"$(jenv init -)"
1
2
3
4
jenv add /opt/homebrew/opt/openjdk@11/libexec/openjdk.jdk/Contents/Home
jenv versions
jenv global 11.0
jenv local 11.0 # per-project override
USB and wireless debugging
Enable Developer Options (Settings → About Phone → tap Build Number seven times), then USB Debugging under Developer Options. Confirm the device shows up:
1
2
adb devices
adb shell getprop ro.product.model
Wireless debugging still needs a USB cable for the initial handshake:
1
2
3
4
adb tcpip 5555
adb shell ip addr show wlan0
adb connect <device-ip>:5555
adb devices
For React Native, forward Metro’s port back to the device instead of relying on the WiFi connection for bundle serving: