How to build Maestro CLI locally?
I want to build the CLI locally to test something out, but the build fails.
Reproduction
git clone [email protected]:mobile-dev-inc/maestro.git&& cd into it./gradlew :maestro-cli:assemble- Observe build failure
Actual result
Failed build logs:
Expected result
I'd like to have clear instructions explaining how to get a local maestro-cli .jar that I can run. This would make it easier for community members to contribute to Maestro CLI (or just Maestro in general).
Environment
-
macOS 13 Ventura
-
Java 11
$ javac --version javac 11.0.20.1$ java --version openjdk 11.0.20.1 2023-08-24 OpenJDK Runtime Environment Temurin-11.0.20.1+1 (build 11.0.20.1+1) OpenJDK 64-Bit Server VM Temurin-11.0.20.1+1 (build 11.0.20.1+1, mixed mode)
Hi there @bartekpacia 👋
Could you try running ./maestro --version from the root and let me know if that works?
Same thing happens:
$ ./maestro --version
e: Supertypes of the following classes cannot be resolved. Please make sure you have the required dependencies in the classpath:
class idb.Idb.LsRequestOrBuilder, unresolved supertypes: MessageOrBuilder
class idb.Idb.MkdirRequestOrBuilder, unresolved supertypes: MessageOrBuilder
// omitted many more similar lines
e: /Users/bartek/dev/bartekpacia/maestro/maestro-ios/build/generated/source/proto/main/kotlin/idb/AccessibilityInfoRequestKt.kt: (8, 79): Cannot access 'com.google.protobuf.GeneratedMessageV3' which is a supertype of 'idb.Idb.AccessibilityInfoRequest'. Check your module classpath for missing or conflicting dependencies
// omitted many more similar lines
Full logs:
Thanks Bartek -- that's weird indeed.
@ArthurSav do you have any insights to share here as you just spun up a new environment?
I faced the same issue. I noticed all errors are from maestro-ios/build directory so I removed it. After that, ./maestro command executed correctly.
I got this working when testing things locally.
I did a clean project, then a rebuild project, then I ran these commands
./gradlew :maestro-cli:installDist -q
and then I could run a sample flow like
./maestro-cli/build/install/maestro/bin/maestro test ~/samples/android-flow.yaml
Here is what I did in case people are interested:
- Make sure
java -versionandjavac -versionis the same version, and it needs to be 17 and not 21. - run
./gradlew clean - run
./gradlew :maestro-cli:installDist -q - After that, run
./maestro-cli/build/install/maestro/bin/maestro studio
This issue has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar problem, please file a new issue. Make sure to follow the template and provide all the information necessary to reproduce the issue. Thank you for helping keep us our issue tracker clean!