visual studio 2015, android command 'run-as' failed

自古美人都是妖i 提交于 2019-12-21 03:56:17

问题


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?


回答1:


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).




回答2:


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.




回答3:


Down load it from Samsung, kies. You will see an option to download the smart switch Click the link in the previous answer...



来源:https://stackoverflow.com/questions/35893436/visual-studio-2015-android-command-run-as-failed

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!