Hi all, sorry i need to take this back: i’m not gonna be able to do this in the next few weeks. Happy to help road-test an alpha version if someone else can pick it up!
Thanks for the update @Rik …the work on modifying the easy-installer is voluntary. Anyone from the community with the development skills can take it up.
Seems like there still is demand for a Mac version: Easy Installer for Mac
I would try myself but don’t have Apple hardware. But even if someone donated a Macbook with 16 GB RAM, I’m not sure I’d find enough time.
I do have the Apple Hardware and I would be willing to have a go. At the moment I’m spending time making unofficial builds (of /e/ and Lineage OS for MicroG). When that’s done, I’ll have a more detailed look at what is involved.
Hello Petefoth,
If you could build Easy Installer for Mac,that would be great.
Now I can’t update my Samsung S9+ myself.
Greetings Johan
OK. I’m ready to start giving this a go, but I could do with some help to give me a head start. I’ve done a little bit of digging but I have a couple of questions to get started.
I haven’t used my Mac for Java development, so I need to start by getting a development environment set up before I can start with the ‘How to build from source with Gradle’ instructions.
- Which jdk to use? I was going to start with Oracle’s Open JDK 15.0.1. Will that be OK or do I need some other version?
- Can anyone recommend a good IDE? I can drive things from the command line, but IDEs sometimes make life easier, and I don’t want to spend time trying different ones.
- There’s a
Dockerfile
at the top level in the code which is very ‘ubuntu-centric’. Is it OK to ignore Docker for building on/for macOS?
Any other tips before I start playing?
Thanks.
The installer targets JDK 11 which is a long term support version. I think I’d go with that. But Open JDK in general is a good choice.
I personally like IntelliJ by Jetbrains for development. I think the free edition is sufficient.
From what I understood the Dockerfile is for the automatic /e/ build system. I think you can just ignore it.
Sorry for the delay.
- I have now successfully built the installer (in Mac OS High Sierra 10.13.6).
- It runs up until the point where it starts trying to detect a connected device.
Details
- Unzip the file
- run
bin/easy-installer
(either from the command line or by double-clicking it from Finder) - it runs, up to the ‘Device detection’ screen. The following appears in the log
17:20:45.653 [JavaFX Application Thread] INFO e.e.i.c.MainWindowController - loadSubScene(enableDevMode)
17:20:45.703 [JavaFX Application Thread] INFO e.e.i.c.s.DeviceDetectedController - startDetection()
17:20:45.713 [Thread-4] INFO e.e.i.tasks.DeviceDetectionTask - runADBDevicesCmd(/Users/pete/adb-fastboot/easy-installer-mac/bin/adb/adb)
17:20:45.739 [Thread-4] DEBUG ecorp.easy.installer.models.Command - getFinalCmd(), Splitted command = /Users/pete/adb-fastboot/easy-installer-mac/bin/adb/adb devices -l
- It does not detect any connected device: the program does nothing more until it is closed, either by clicking the red close button, or by pressing
<ctrl>+c
in the terminal it was run from
(Running the packagedadb
,adb devices -l
outside of the installer gives the expected output)
Other stuff
- The window buttons (Full screen, Minimize, Exit) work as expected
- Clicking ‘Donate’ button does nothing. The following appears in the log
17:16:51.507 [JavaFX Application Thread] ERROR e.e.i.c.MainWindowController - url = https://e.foundation/donate/, error = java.io.IOException: Cannot run program "open": error=2, No such file or directory
- clicking ‘Need help’ button does nothing. The following appears in the log
17:18:38.059 [JavaFX Application Thread] ERROR e.e.i.c.MainWindowController - url = http://e.foundation, error = java.io.IOException: Cannot run program "open": error=34, Result too large
- Exactly the same behaviour running on a different machine running macOS Catalina version 10.15.7
Note that I don’t have access to any of the supported devices: I have tried connecting an Xperia Z5 Compact (suzuran) and an Xperia XZ1 Compact (lilac), both running /e/ Custom builds.
If anyone else fancies looking onto this, this folder contains the installer zip file, and a full log from a single run of the app.
I’ll have a think about what to try next: any ideas, or other input would be welcome
Are there any more lines after the Splitted command
in the log when the installer does not detect a connected phone?
From a successful run on Linux I have lines like this
2020-11-16 18:12:43,285 DEBUG [Thread-3] e.e.i.m.Command [null:-1] getFinalCmd(), Splitted command = /snap/easy-installer/12/easy-installer-linux-x64/bin/adb/adb devices -l
2020-11-16 18:12:43,292 INFO [Thread-3] e.e.i.m.Command [null:-1] Command's Process started
2020-11-16 18:12:43,407 DEBUG [Thread-3] e.e.i.m.Command [null:-1]
(debug)* daemon not running; starting now at tcp:5037
2020-11-16 18:12:43,507 DEBUG [Thread-3] e.e.i.m.Command [null:-1]
(debug)* daemon started successfully
2020-11-16 18:12:43,507 DEBUG [Thread-3] e.e.i.m.Command [null:-1]
(debug)List of devices attached
2020-11-16 18:12:43,508 DEBUG [Thread-3] e.e.i.m.Command [null:-1]
(debug)
I don’t know how to check this on Mac OS, but can you see if the installer starts an adb
process?
The code essentially is like this
ProcessBuilder pb;
pb = new ProcessBuilder(getFinalCmd());
pb.redirectErrorStream(true);
pc= pb.start();
logger.info("Command's Process started");
Looks like you’re not getting to the logger.info("Command's Process started");
line, because that output was not in your log. So it seems like the pb.start()
doesn’t finish.
Edit: can you run it with a debugger and set a breakpoint at pc= pb.start();
When the debugger stops at that breakpoint, what happens if you “step over” that line?
In IntelliJ you’d click in the grey area right of the line number to set the breakpoint (a red circle will appear) and then you can start the debugger from the “Gradle” menu like below
Thanks
I’ve managed up to now without an IDE: the gradle build ran fine from the command line.
I’ve downloaded JetBrains IntelliJ IDEA. Tomorrow I’ll install it and do some debugging - takes me back to being at work
I’ve opened the project in IDEA, but it fails to build with the following error:
Cause: org/openjfx/gradle/JavaFXPlugin has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
It builds fine from the command line using gradlew.
History suggests that I can spend a lot of time trying to work out how to resolve the dependency / version problem in the IDE, when really what I want to do is jump to the debugging. Any ideas / suggestions welcomed before I start random button pressing
That error also happened here: /e/ OS “easy” installer: development thread about adding new devices - #15 by andrelam
But there is no hint in that topic how to resolve this.
One idea: check the settings for Gradle in IntelliJ. For me it looks like this
Edit: according to https://stackoverflow.com/a/62130653/6309275 that message points to the wrong Java version. 52.0 as class version means, IntelliJ is either using Java 8 or a higher version of the Java SDK that is configured to only allow Java 8 features.
Anyway, I’d first check the settings from above screenshot. Sounds a bit like the wrong Gradle JVM could be the issue.
Currently I have things setup so that building appears to be successful, though there don’t appear to be any build artefacts created anywhere.
When I try to run or debug, then I get the following errors (plus loads more)
org.gradle.api.resources.ResourceException: Could not get resource 'https://mvnrepository.com/org/yaml/snakeyaml/1.26/snakeyaml-1.26.pom'.
org.gradle.internal.resource.transport.http.HttpErrorStatusCodeException: Could not HEAD 'https://mvnrepository.com/org/yaml/snakeyaml/1.26/snakeyaml-1.26.pom'. Received status code 403 from server: Forbidden
org.gradle.api.resources.ResourceException: Could not get resource 'https://mvnrepository.com/ch/qos/logback/logback-core/1.2.3/logback-core-1.2.3.pom'.
org.gradle.internal.resource.transport.http.HttpErrorStatusCodeException: Could not HEAD 'https://mvnrepository.com/ch/qos/logback/logback-core/1.2.3/logback-core-1.2.3.pom'. Received status code 403 from server: Forbidden
org.gradle.api.resources.ResourceException: Could not get resource 'https://mvnrepository.com/javax/servlet/javax.servlet-api/4.0.1/javax.servlet-api-4.0.1.pom'.
org.gradle.internal.resource.transport.http.HttpErrorStatusCodeException: Could not HEAD 'https://mvnrepository.com/javax/servlet/javax.servlet-api/4.0.1/javax.servlet-api-4.0.1.pom'. Received status code 403 from server: Forbidden
It looks like it’s trying to pull snakeyaml
, logback
and maybe more stuff from somewhere that doesn’t want me to have access. Yet if I build from the command line (./gradlew dist
) there are no problems. I suspect this is because the project isn’t set up correctly in IDEA
I’m probably going to take a break as I’m just getting angry trying to run a tool that I don’t have any experience of.
Cause: org/openjfx/gradle/JavaFXPlugin has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
In fact I get the same error on a fresh copy of the installer.
And my suspicion was right: the default “Gradle JVM” is the problem. The one bundled with IntelliJ is used and for some reason that is only Java 8.
I’ll add a note to the troubleshooting howto.
For that mavenrepository.com problem: I get a 404 Not Found instead of 403 Forbidden when I try curl --head https://mvnrepository.com/org/yaml/snakeyaml/1.26/snakeyaml-1.26.pom
The Resource seems to be managed by Cloudflare which might explain it behaves differently for different users (regions).
But I do not see that error when running the installer in IntelliJ (with correct Gradle JVM). Maybe a 404 is handled “properly” while a 403 is not (just guessing, though).
I can build no problem from the command line. I’m investigating if I can debug that build using IntelliJ
I have some hints for you:
Error:
To solve:
Right click on project (in my case ei easy installer) > Open module settings
Project > Project SDK
I choose this JDK (Not sure if this is ok, but it works…)
Go to preferences, select gradle and select the j9-11 JVM.
Now i could build and run easy installer. Good luck.
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
Thanks but no joy. When I build, it succeeds. When I run or debug if fails building EasyInstaller.Main. I don’t understand what the IDE is trying to do, or how it works out the project structure, or why one type of build works and another fails. And debugging IDE configurations is not a class of problem that interests me |'ll let someone who has some idea of how it is supposed to work take it forward from here.
As I said in my earlier post, I’ll carry on by looking at how to support a new device
Did you run it here:
No. I hadn’t spotted that. I had been trying to run and debug in some other way. I’m setting breakpoints and looking at data as we speak
Thanks again