0

I am new to java and Andriod studio development. I working on an app that need to run "gradlew assembleDebug" command in the app itself. is that possible?

1
  • You want to run the command on the smartphone running Android? To build an android app from the android app? Commented Apr 4, 2020 at 11:27

1 Answer 1

1

Android does not ship with any build tools inside it. On your phone, there is no gradle.

In theory you can make an app that ships these tools but this is very complicated; that sounds like a project far beyond sensible for someone new to java and android development.

--

Or, did you mean: You are writing a plugin for Android Studio and it needs to run gradlew? That doesn't sound like a good idea: Android Studio itself does a bunch of stuff around invoking gradle and may have it built in; you should tell studio to invoke it, instead of doing it yourself. I don't know how that's done, though.

--

If you really want to invoke commands, use ProcessBuilder. But as I said, this is not what you want to do here.

Sign up to request clarification or add additional context in comments.

1 Comment

thanks.am not new to java I said so because my last question attracted a lot of criticises.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.