Debug native application on Samsung 4.4.2 “package is unknown” with run-as command

后端 未结 1 1750
野性不改
野性不改 2021-01-17 04:11

While trying to debug an Android native application via Eclipse on a Galaxy S4 i get a \"package is unknown\" error at the run-as command.

There\'s an open issue at

相关标签:
1条回答
  • 2021-01-17 04:51

    I have been breaking my head for several days as well now on this issue. At the time of writing, I was able to debug native code on a Samsung phone with Android 4.1.2. However a Samsung Galaxy S5 with Android 4.4.2 keeps confronting me with:

    gdbserver output:

    run-as: Package 'x.y.z' is unknown

    Verify if the application was built with NDK_DEBUG=1

    As an "ugly" workaround, it seems possible to change the permissions of 'run-as' from 750 into 4750 on a rooted device; on a Windows 7 machine:

    • connect your device with USB to the host PC
    • open a command prompt on the host PC
    • go to the platform-tools folder of the Android-sdk folder
    • execute "adb shell"
    • in the shell, do "sudo chmod 4750 /system/bin/run-as"

    Theoretically this should solve the problem. I'm unable to test this however as I don't have a rooted device at the moment. I would be happy to see if someone can actually test this and post a result.

    I found the following 2 references related to this issue very interesting:

    • the Android issue 58373, my take-aways are:

      • google has patched this issue for Android 4.4. (see comment #51 and #52 of the referenced link, which provides the actual patches)

      • Samsung does seem to have a proper Android build and the respective patches might not have been included (see comment #76) (this statement might need some challenging)

    • The Samsung forum, my take-away:

      • Some people report that it has been fixed, some report that it hasn't.
    0 讨论(0)
提交回复
热议问题