The environments: windows 10(home, pro), visual studio 2015(community, professional) all combination.
Start visual studio 2015 update 1, new project, Native-Activity Application(Android), thus make default android native app. Build solution and start debugging. Then such error message is presented:
.
Unable to start debugging. Android command 'run-as' failed. Package 'com.Android1' is unknown.
I googled, but cannot find how to solve. What I missed? How to set up my environments, or fix something?
The solution to this is that you must root your device and fix a file permission. You can try following the advice on the prompt (especially if rooting is not an option) but in some cases only a root will fix the issue.
Once you have rooted your device open an adb shell and run the following:
su
mount -o remount,rw /system
chmod 4750 /system/bin/run-as
mount -o remount,ro /system
This fixes the setuid permission so that the run-as process is granted access based on the owner of the file (i.e. root).
I had a very similar issue on Samsung Galaxy S6 Edge, trying to start debugging on VS2015, I got a different error, much less verbose than in the attached screenshot:
run-as: Could not set capabilities: Operation not permitted
Based on the contents of the attached screenshot above, I tried 'initializing' / factory resetting the device using Samsung's Smart Switch and it actually fixed the 'run-as' issue I was having.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With