Visual Studio 2015,Android命令“运行方式"失败 [英] visual studio 2015, android command 'run-as' failed

查看:103
本文介绍了Visual Studio 2015,Android命令“运行方式"失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

环境:Windows 10(家庭,专业版),Visual Studio 2015(社区,专业版)全部组合.

The environments: windows 10(home, pro), visual studio 2015(community, professional) all combination.

启动Visual Studio 2015更新1,创建新项目Native-Activity Application(Android),从而将其设置为默认的android native应用.生成解决方案并开始调试.然后出现这样的错误消息:

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:

.

无法开始调试. Android命令运行方式"失败.程序包"com.Android1"未知.

Unable to start debugging. Android command 'run-as' failed. Package 'com.Android1' is unknown.

我用Google搜索,但是找不到解决方法.我错过了什么?如何设置我的环境或解决问题?

I googled, but cannot find how to solve. What I missed? How to set up my environments, or fix something?

推荐答案

此问题的解决方案是您必须使设备具有root用户权限并修复文件许可权.您可以尝试按照提示中的建议进行操作(特别是如果没有选择生根"的话),但在某些情况下,只有根"才能解决该问题.

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.

将设备植根后,请打开adb shell并运行以下命令:

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

这修复了setuid权限,以便根据文件的所有者(即根)授予运行方式进程访问权限.

This fixes the setuid permission so that the run-as process is granted access based on the owner of the file (i.e. root).

这篇关于Visual Studio 2015,Android命令“运行方式"失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆