run adb as root by Visual Studio

gianmeregianmere Member ✭✭

I have a problem to debug my application because I can't run adb as root by Visual Studio.

My application does some stuffs when the device boot, by a BroadcastReceiver on Android.Content.Intent.ActionBootCompleted.
I want to test what happens without reboot the device.
I know I can use the following command:
adb shell am broadcast -a android.intent.action.BOOT_COMPLETED
But it works only if I start asb server by root.
When I start adb by Visual Studio, running my application, it starts by normal user.
If a restart adb in root mode, by the command "adb root", Visual Studio detach from the device, and I can't debug my application.

How can I run adb as root with Visual Studio, to debug my application when a BroadcastReceiver on Android.Content.Intent.ActionBootCompleted happens?

Thanks

Best Answer

  • gianmeregianmere ✭✭
    Accepted Answer

    Ok, it was pretty simple.
    The "secret" is to start adb as root before start the application by Visual Studio.

Answers

  • gianmeregianmere Member ✭✭
    Accepted Answer

    Ok, it was pretty simple.
    The "secret" is to start adb as root before start the application by Visual Studio.

Sign In or Register to comment.