设置用于开发的设备(???????????? 无权限) [英] set up device for development (???????????? no permissions)

查看:21
本文介绍了设置用于开发的设备(???????????? 无权限)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是三星 Galaxy nexus 手机(Android 4.0 平台).

I am using a Samsung galaxy nexus phone (Android 4.0 platform) .

我正在 Ubuntu linux 操作系统上开发 Android 应用程序.我想直接在三星手机设备上运行我的应用程序,所以我执行了以下设置步骤:

I am developing Android app on Ubuntu linux OS. I would like to run my application directly on the Samsung handset device, so I performed the following setup steps:

  1. 在我的项目 AndroidManifest.xml 文件中,将 android:debuggable="true" 添加到 元素

  1. in my project AndroidManifest.xml file, added android:debuggable="true" to the <application> element

在设备上,在设置>安全中启用未知来源

在设备上,在设置>开发者选项中启用USB调试

在我的电脑上,创建了 /etc/udev/rules.d/51-android.rules 文件,内容如下:

On my computer, created the /etc/udev/rules.d/51-android.rules file with the following content:

SUBSYSTEM=="usb", ATTR{idVendor}=="04E8", MODE="0666", GROUP="plugdev" 

  • 在我的电脑上,运行 chmod a+r/etc/udev/rules.d/51-android.rules 命令

    然后,在我的电脑上打开一个终端并执行 adb devices 命令,我得到:

    Then, on my computer I opened a terminal and executed the adb devices command, I got:

    List of devices attached 
    ????????????    no permissions
    

    因为我没有看到我的设备而只有 ????????????没有权限,然后我运行以下命令:

    Since I did not see my device but only ???????????? no permissions, I then run the following commands:

     adb kill-server
     adb start-server
     adb devices
    

    但我仍然得到:

    List of devices attached 
    ????????????    no permissions
    

    为什么?我错过了什么?

    Why? What am I missing?

    推荐答案

    对我有用的是杀死并重新启动 adb 服务器.在 linux 上:sudo adb kill-server 然后 sudo adb start-server.然后它会检测到几乎所有开箱即用的设备.

    What works for me is to kill and start the adb server again. On linux: sudo adb kill-server and then sudo adb start-server. Then it will detect nearly every device out of the box.

    这篇关于设置用于开发的设备(???????????? 无权限)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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