Problem description
When building for Android Device with also the Android simulator open, a misleading bad error message is displayed.
Steps to reproduce
1. Connect an Android device, create a default new project and build for Android simulator
2. Build for Android real device (both from Studio and CLI)
Result:
1. App build and automatically run as expected on the simulator
2. App build and is actually correctly installed on the real device. However, the App it's not starting up automatically on device and a misleading bad error message is displayed on the console log.
[DEBUG] Waiting for device to be ready ...
[TRACE] adb devices returned 2 devices/emulators
[DEBUG] Device connected... (waited 0 seconds)
[DEBUG] waited 0.019870 seconds on emulator to get ready
[INFO] Installing application on device
[DEBUG] /Users/fcasali/tools/android-sdk-mac_x86/platform-tools/adb -d install -r /Users/fcasali/Documents/Titanium_Studio_Workspace2/testProject/build/android/bin/app.apk
[INFO] Application installed. Launch from drawer on Home Screen
[INFO] Launching appliation on device.
error: more than one device and emulator
[ERROR] Project failed to build after 29s 590ms
Behavior reproducible with latest Appcelerator and Titanium Studio version.
It was not reproducible building from Studio 3.0-GA version - however it was reproducible building from console with CLI version 3.0.24-GA.
I wonder if "adb devices" is returning both the emulator and the device and the build script gets confused which one to use?
Dupe of TIMOB-12600.
Closing ticket as duplicate with reference to the above comments.