maestro icon indicating copy to clipboard operation
maestro copied to clipboard

How to build Maestro CLI locally?

Open bartekpacia opened this issue 3 years ago • 7 comments

I want to build the CLI locally to test something out, but the build fails.

Reproduction

  1. git clone [email protected]:mobile-dev-inc/maestro.git && cd into it
  2. ./gradlew :maestro-cli:assemble
  3. Observe build failure

Actual result

Failed build logs:

build_crash_logs.txt

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)
    

bartekpacia avatar Sep 17 '23 11:09 bartekpacia

Hi there @bartekpacia 👋

Could you try running ./maestro --version from the root and let me know if that works?

axelniklasson avatar Sep 18 '23 08:09 axelniklasson

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:

crash_logs.txt

bartekpacia avatar Sep 18 '23 16:09 bartekpacia

Thanks Bartek -- that's weird indeed.

@ArthurSav do you have any insights to share here as you just spun up a new environment?

axelniklasson avatar Sep 19 '23 05:09 axelniklasson

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.

xo0ps avatar Oct 06 '23 12:10 xo0ps

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

testifyqa avatar Oct 14 '23 18:10 testifyqa

Here is what I did in case people are interested:

  1. Make sure java -version and javac -version is the same version, and it needs to be 17 and not 21.
  2. run ./gradlew clean
  3. run ./gradlew :maestro-cli:installDist -q
  4. After that, run ./maestro-cli/build/install/maestro/bin/maestro studio

hackgoofer avatar Nov 19 '23 08:11 hackgoofer

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!

github-actions[bot] avatar Jul 11 '24 10:07 github-actions[bot]