title: Adding a prebuilt binary in Android source
body: <p>I have a native binary that I want to include into Android's source code, so that when I compile it my binary will be included in /system/bin .</p>
  
  <p>I've copied my binary into the folder /prebuilt/android-arm/my-binary , and I've created a new Android.mk with the following:</p>
  
  <pre><code>LOCAL_PATH := $(call my-dir)
  include $(CLEAR_VARS)
  
  LOCAL_SRC_FILES := my-binary
  LOCAL_MODULE := my-binary
  LOCAL_MODULE_CLASS := EXECUTABLES
  LOCAL_MODULE_TAGS := optional
  include $(BUILD_PREBUILT)
  </code></pre>
  
  <p>But when I run <em>make</em>, the only reference I get in the log is the following:</p>
  
  <pre><code>target Prebuilt: my-binary (out/target/product/generic/obj/EXECUTABLES/my-binary_intermediates/my-binary)
  </code></pre>
  
  <p>And the binary isn't installed into system.img at all. There's an almost identical question in <a href="https://stackoverflow.com/questions/1043257/installing-a-prebuilt-binary-on-android-not-found">Installing a prebuilt binary on Android: &quot;not found&quot;</a> , but the asker already knew the basic procedure and it isn't explained at all. If I run <em>make my-binary</em>, I get the same line I posted.</p>
  
  <p>I've also tried to run <em>make out/target/product/generic/system.img my-binary</em> but it doesn't work either. My binary shows up in the the <em>out</em> subfolder but it won't be included into system.imng</p>
  
  <p>Am I missing something? Is there any way so that with just running <em>make -j#</em> my binary will be included in /system/bin ?</p>