To reproduce:
- not consistently reproducible, retry steps if needed
1. Open terminal and execute "adb kill-server"
2. Open a new project
3. Open terminal and execute "sudo netstat -tulpn | grep "Unity""
4. Look for processes running on "0.0.0.0:5555"
5. Execute "adb devices"
6. Observe "emulator-5554 offline"
Reproducible with: 2018.3.0b5, 2018.4.0f1, 2019.1.1f1, 2019.3.0a2
Unable to reproduce with: 2017.4.27f1, 2018.2.21f1
Unable to reproduce on Windows, MacOS
Some Unity process (most often UnityShaderCompiler) uses TCP address 0.0.0.0:5555 which conflicts with ADB emulator port range (5555-5585) https://developer.android.com/studio/command-line/adb#howadbworks
When a user starts up an adb client with 'adb devices' command, adb sees port 5555 being used and thinks that there is an android device/emulator that is offline (see issue.png screenshot). The issue with this is that a user cannot build the project for Android player until the "offline emulator" is hanging.
Workarounds:
- kill the process that uses port 5555
- execute terminal commands "adb kill-server && adb devices" until the "emulator-5554 offline" no longer appears