Today I learned (or remembered):
- IDEs are a waste of time, effort and motivation
- Doing something else - e.g. go for a run - gives a fresh perspective on frustrating problems
I can build the installer using ./gradlew dist
If I run the built binary from the build directory, build/image/easy-installer-mac/bin/easy-installer
it works as expected, detects a connected device, and reports that the device is not supported . The interesting bits of the log are
19:04:50.772 [JavaFX Application Thread] DEBUG ecorp.easy.installer.EasyInstaller -
OS name = Mac OS X
Java Home = /Users/pete/easy-installer/build/image/easy-installer-mac
Current working dir = /Users/pete/easy-installer
ADB folder path = /Users/pete/easy-installer/build/image/easy-installer-mac/bin/adb/
...
19:05:10.608 [Thread-5] INFO e.e.i.tasks.DeviceDetectionTask - runADBDevicesCmd(/Users/pete/easy-installer/build/image/easy-installer-mac/bin/adb/adb)
19:05:10.610 [Thread-5] DEBUG ecorp.easy.installer.models.Command - getFinalCmd(), Splitted command = /Users/pete/easy-installer/build/image/easy-installer-mac/bin/adb/adb devices -l
19:05:10.618 [Thread-5] INFO ecorp.easy.installer.models.Command - Command's Process started
19:05:10.624 [Thread-5] DEBUG ecorp.easy.installer.models.Command -
(debug)List of devices attached
Then try with the build zip file
cp build/distributions/easyInstaller-mac.zip ~/temp/
cd ~/temp
unzip easyInstaller-mac.zip
easy-installer-mac/bin/easy-installer
this hangs as before
...
OS name = Mac OS X
Java Home = /Users/pete/temp/easy-installer-mac
Current working dir = /Users/pete/temp
ADB folder path = /Users/pete/temp/easy-installer-mac/bin/adb/
...
18:36:44.903 [JavaFX Application Thread] INFO e.e.i.c.s.DeviceDetectedController - startDetection()
18:36:44.922 [Thread-4] INFO e.e.i.tasks.DeviceDetectionTask - runADBDevicesCmd(/Users/pete/temp/easy-installer-mac/bin/adb/adb)
18:36:44.928 [Thread-4] DEBUG ecorp.easy.installer.models.Command - getFinalCmd(), Splitted command = /Users/pete/temp/easy-installer-mac/bin/adb/adb devices -l
Next I try and run using using gradelw ./gradlew run
. This also fails at the same point
18:43:40.852 [Thread-4] INFO e.e.i.tasks.DeviceDetectionTask - runADBDevicesCmd(/Users/pete/easy-installer/buildSrc//adb/adb)
18:43:40.858 [Thread-4] DEBUG ecorp.easy.installer.models.Command - getFinalCmd(), Splitted command = /Users/pete/easy-installer/buildSrc//adb/adb devices -l
(note in that instance there are two\
characters in the adb
path, but that isn’t always the case)
In the cases where it fails, it is in the Command.execAndReadOutput()
method, somewhere in the following lines (after the call to getFinalCmd()
, before the logger
call
pb = new ProcessBuilder(getFinalCmd());
}
pb.redirectErrorStream(true);
pc= pb.start();
logger.info("Command's Process started");
I can add some logger commands to determine exactly where, but I suspect it will be in the pb.start()
call and that it’s starting the adb
process that never returns.
Not sure how much further I can take this because a: it sometimes works and b: once beyond this point, I need a supported phone otherwise I won’t be able to test the rest of the functionality. So I’ll have another quick look at IDEA in the light of your most recent post - thanks - and then I’ll explore the How to support a new device
topic