exec command android native code

前端 未结 2 1084
日久生厌
日久生厌 2021-01-14 21:05

I am trying to launch an android applications from native code.

In adb shell we can launch applications using \"am\" command.

Link:

How to run (not o

2条回答
  •  囚心锁ツ
    2021-01-14 21:33

    I got the answer... I 'exec'ed the shell itself and gave it the command... It worked

    ret = execl("/system/bin/sh", "sh", "-c", "am start -a android.intent.action.MAIN -n   com.android.browser/.BrowserActivity", (char *)NULL);
    

    Thanks to m0skit0, Padma Kumar, Yuri ...

提交回复
热议问题