post install step for cc_binary

Skip to first unread message

Abhayadev S

Oct 4, 2021, 3:13:59 PM10/4/21
to Android Building


I have a cc_binary module (name myBin) defined in in a/b/Android.bp which is building fine and installs the binary in to out/..../system/bin/myBin

Now, every time the binary is built, i need to copy this binary in to another git repo project cloned in a/b/bins/ to keep the prebuilts

so, is there post build/install options i can use inside the Android.bp ?


Dan Willemsen

Oct 4, 2021, 6:38:25 PM10/4/21
No, the source tree should be considered read-only from within the build. I'd suggest doing this as a wrapper around the build, rather than inside the build. You can set up `dist` options so that `m ... dist` builds will copy artifacts (and logs -- it's meant to be used on build servers) to $DIST_DIR (defaults to out/dist/) after a build, but you'd still need something wrapping the build to put them where you wanted, so that may or may not simplify things.

- Dan

You received this message because you are subscribed to the "Android Building" mailing list.
To post to this group, send email to
To unsubscribe from this group, send email to
For more options, visit this group at

You received this message because you are subscribed to the Google Groups "Android Building" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To view this discussion on the web visit

Abhayadev S

Oct 8, 2021, 5:37:59 PM10/8/21
to Android Building
I was just trying out the "LOCAL_POST_INSTALL_CMD" (to execute some short shell scripts) and it works now in the
I could not find an equivalent for Android.bp though, do you know of any?

any way it works for now :)

Reply all
Reply to author
0 new messages