<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>i.MX ProcessorsのトピックRe: run an executable and script during Android bootup</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/run-an-executable-and-script-during-Android-bootup/m-p/908772#M136963</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A class="jx-jive-macro-user" href="https://community.nxp.com/people/maneeshsingh"&gt;maneeshsingh&lt;/A&gt;‌,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You need to create the service and&amp;nbsp;defined the selinux policy.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For your reference,&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.nxp.com/thread/513396"&gt;https://community.nxp.com/thread/513396&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;VinothS,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 12 Oct 2019 08:20:14 GMT</pubDate>
    <dc:creator>vinothkumars</dc:creator>
    <dc:date>2019-10-12T08:20:14Z</dc:date>
    <item>
      <title>run an executable and script during Android bootup</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/run-an-executable-and-script-during-Android-bootup/m-p/908765#M136956</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sir,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using iMX8M EVK with Android 9.0 running on it. I downloaded and build the AOSP 9.0 for iMX8M and now using it with my EVK board.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have created a executable and After Android boots up i can copy my executable into /data/local/tmp directory and run it using adb.&amp;nbsp;&lt;/P&gt;&lt;P&gt;for e.g. - In data/local/tmp i can run my executable as =&amp;gt; ./my_executable&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But Now i want to run my executable during Android boot up time.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I mean to say instead of manually copying and running the executable i want to make it part of AOSP and when AOSP boot up that time only my executable should also run.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In below thread they given the solution to do changes in /etc/rc.local script for Linux&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" class="link-titled" href="https://community.nxp.com/message/820999?commentID=820999#comment-820999" title="https://community.nxp.com/message/820999?commentID=820999#comment-820999"&gt;https://community.nxp.com/message/820999?commentID=820999#comment-820999&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But for Android / AOSP how can i do that ??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Maneesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Aug 2019 11:10:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/run-an-executable-and-script-during-Android-bootup/m-p/908765#M136956</guid>
      <dc:creator>msingh1920</dc:creator>
      <dc:date>2019-08-09T11:10:24Z</dc:date>
    </item>
    <item>
      <title>Re: run an executable and script during Android bootup</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/run-an-executable-and-script-during-Android-bootup/m-p/908766#M136957</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Maneesh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is also an init.rc file in Android, albeit it is handled a bit differently. You can see how it works on the following document from Google’s repositories.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://android.googlesource.com/platform/system/core/+/master/init/README.md"&gt;https://android.googlesource.com/platform/system/core/+/master/init/README.md&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You could the exec command or create a service that runs your application.&lt;BR /&gt; &lt;/P&gt;&lt;P&gt;I hope this helps!&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Aug 2019 19:12:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/run-an-executable-and-script-during-Android-bootup/m-p/908766#M136957</guid>
      <dc:creator>gusarambula</dc:creator>
      <dc:date>2019-08-09T19:12:23Z</dc:date>
    </item>
    <item>
      <title>Re: run an executable and script during Android bootup</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/run-an-executable-and-script-during-Android-bootup/m-p/908767#M136958</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gusarambula,&lt;/P&gt;&lt;P&gt;Thanks for your reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. how can I use exec command to run my application ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. And you said I can&amp;nbsp; create a service to run the application ? so what is the steps for&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; creating a service to run the applications ? for creating service we may face some selinux related issues&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; hence is there any simpler way by which i can run my application ?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. Is there any reference which i can refer for creating service to run application at bootup ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Maneesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 10 Aug 2019 14:59:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/run-an-executable-and-script-during-Android-bootup/m-p/908767#M136958</guid>
      <dc:creator>msingh1920</dc:creator>
      <dc:date>2019-08-10T14:59:44Z</dc:date>
    </item>
    <item>
      <title>Re: run an executable and script during Android bootup</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/run-an-executable-and-script-during-Android-bootup/m-p/908768#M136959</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any suggestion or update over this ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Maneesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Aug 2019 08:05:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/run-an-executable-and-script-during-Android-bootup/m-p/908768#M136959</guid>
      <dc:creator>msingh1920</dc:creator>
      <dc:date>2019-08-12T08:05:21Z</dc:date>
    </item>
    <item>
      <title>Re: run an executable and script during Android bootup</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/run-an-executable-and-script-during-Android-bootup/m-p/908769#M136960</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Maneesh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is some interesting documentation on the Android Developers documentation and forums, like for example:&lt;/P&gt;&lt;P&gt;&lt;A href="https://android.googlesource.com/platform/system/core/+/master/init/README.md"&gt;https://android.googlesource.com/platform/system/core/+/master/init/README.md&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://developer.android.com/training/run-background-service/create-service"&gt;https://developer.android.com/training/run-background-service/create-service&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would recommend looking for more guidelines there as NXP documentation does not cover these topics.&lt;/P&gt;&lt;P&gt;I hope this helps!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Aug 2019 19:12:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/run-an-executable-and-script-during-Android-bootup/m-p/908769#M136960</guid>
      <dc:creator>gusarambula</dc:creator>
      <dc:date>2019-08-13T19:12:38Z</dc:date>
    </item>
    <item>
      <title>Re: run an executable and script during Android bootup</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/run-an-executable-and-script-during-Android-bootup/m-p/908770#M136961</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gusarambula,&lt;/P&gt;&lt;P&gt;Thanks for your reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am looking into the Links provided by you and doing some search on internet also for the same.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I just to want to update you that i am able to make some progress but still got stuck at some place.&lt;/P&gt;&lt;P&gt;here is the steps which i am doing -&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. I added following lines in init.rc file of&amp;nbsp; AOSP /device/fsl/imx8m/evk_8mm -&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;on property:dev.bootcomplete=1&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; exec u:r:shell:s0 shell shell input log adb sdcard_rw sdcard_r net_bt_admin net_bt inet net_bw_stats -- /system/bin/sh /system/bin/myScript start -n com.example.package/com.example.package.MainActivity&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. And i created a myScript file and added following line into it -&amp;nbsp;&lt;/P&gt;&lt;P&gt;--------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; #!/system/bin/sh&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mkdir /data/local/tmp/DirFromMyScript&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #Run My Application in background&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; exec helloApp &amp;amp;&lt;/P&gt;&lt;P&gt;---------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. NOTE -&amp;nbsp; I kept this myScript and helloApp executable files in AOSP /out/target/product/evk_8mm/system/bin&amp;nbsp; directory.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4. After that i compiled the AOSP and flashed it on SDCARD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;5. When i Boot the AOSP on my iMX8M mini EVK i am able to see DirFromMyScript Directory in /data/local/tmp&amp;nbsp; created by myScript&lt;/P&gt;&lt;P&gt;but i am not able to see 'helloApp' running.&lt;/P&gt;&lt;P&gt;when i run 'ps' command i dind't see my executable 'helloApp' name there.&amp;nbsp; not with top command also.&lt;/P&gt;&lt;P&gt;NOTE - in my executable -&amp;nbsp;helloApp i do lots of stuff like file creation, directory creation etc..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; so i can see 1 or 2 file is created by&amp;nbsp; 'helloApp' but after that i think its getting existed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; it means helloApp did run but it is getting terminated or existed hence not able to complete all the task.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;6. NOTE - When I manually run myScript&amp;nbsp; that time my executable 'helloApp'&amp;nbsp; runs properly and it completes all the task. .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;7. I want to run this executable in background from myScript during boot time. but i am not able to understand how to do that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any suggestion how can run executable binary from myScript ??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Maneesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Aug 2019 14:55:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/run-an-executable-and-script-during-Android-bootup/m-p/908770#M136961</guid>
      <dc:creator>msingh1920</dc:creator>
      <dc:date>2019-08-14T14:55:56Z</dc:date>
    </item>
    <item>
      <title>Re: run an executable and script during Android bootup</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/run-an-executable-and-script-during-Android-bootup/m-p/908771#M136962</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Maneesh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The steps look okay, but I’m afraid we do not have documentation that covers this, so your safest bet would be posting a question on the Android Developer forums especially as Android 9 is relatively new and each release changes somewhat how permissions and services work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My apologies for the inconvenience,&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Sep 2019 19:25:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/run-an-executable-and-script-during-Android-bootup/m-p/908771#M136962</guid>
      <dc:creator>gusarambula</dc:creator>
      <dc:date>2019-09-02T19:25:51Z</dc:date>
    </item>
    <item>
      <title>Re: run an executable and script during Android bootup</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/run-an-executable-and-script-during-Android-bootup/m-p/908772#M136963</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A class="jx-jive-macro-user" href="https://community.nxp.com/people/maneeshsingh"&gt;maneeshsingh&lt;/A&gt;‌,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You need to create the service and&amp;nbsp;defined the selinux policy.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For your reference,&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.nxp.com/thread/513396"&gt;https://community.nxp.com/thread/513396&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;VinothS,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 12 Oct 2019 08:20:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/run-an-executable-and-script-during-Android-bootup/m-p/908772#M136963</guid>
      <dc:creator>vinothkumars</dc:creator>
      <dc:date>2019-10-12T08:20:14Z</dc:date>
    </item>
  </channel>
</rss>

