android usb fm,Android device is not connected to USB for debugging (Android studio)

本文档详细介绍了如何在Linux(Redhat和Ubuntu)以及Windows环境下通过ADB命令行工具连接到启用USB调试的手机。首先确保设备管理器运行ADB命令,然后在命令行中启动ADB服务器。如果看到“未授权”的提示,手机上会弹出授权对话框,点击确认后,设备将显示为已连接,此时可以执行shell、push、pull等操作。
摘要由CSDN通过智能技术生成

How to get connection to device working using adb command line:

USB debugging enabled on phone and phone connected.

I am exercising these commands on linux(redhat and ubuntu) but same commands work under the hood on windows. The device manager runs adb commands. You can find a console in your device manager or regular command-line works if you set up your paths to SDK.

If you can run adb and see something like ???????? in devices list ..

$ android-studio/sdk/platform-tools/adb devices

List of devices attached

???????????? no permissions

You might be running the adb server as a regular user.

You might have to run the adb server as root.

So kill the server as regular user and start it as root.

$ adb kill-server

$ which adb

$ sudo /android-studio/sdk/platform-tools/adb start-server

Now look at adb devices list, if it is first time this machine connects to this phone you will see "unauthorized".

$ adb devices

List of devices attached

MWS0216A31xxxxxx unauthorized

At this point on phone you should have dialog popped up and you can tap ok to authorize. Then you should see "device" in the devices list and commands like shell/push/pull/sync/backup... should work.

$ adb devices

List of devices attached

MWS0216A31xxxxxx device

$ adb shell "uname -a; df; ls /storage/sdcard0/Download"

Linux localhost 3.10.90-g2ff1b22 #1 SMP PREEMPT Tue Dec 27 17:12:50 CST 2016 aarch64

Filesystem Size Used Free Blksize

/dev 1.3G 108.0K 1.3G 4096

/sys/fs/cgroup 1.3G 12.0K 1.3G 4096

/mnt 1.3G 0.0K 1.3G 4096

/sys/fs/cgroup/pids: Permission denied

/system 2.4G 2.3G 106.8M 4096

/cust 492.0M 327.7M 164.3M 4096

/cache 248.0M 160.0K 247.8M 4096

/splash2: Permission denied

/3rdmodem 59.0M 4.9M 54.1M 1024

/3rdmodemnvm: Permission denied

. .

/storage 1.3G 0.0K 1.3G 4096

/data 25.1G 10.9G 14.2G 4096

/mnt/runtime/default/emulated: Permission denied

/storage/emulated 25.1G 11.2G 13.8G 4096

/mnt/runtime/read/emulated: Permission denied

/mnt/runtime/write/emulated: Permission denied

.

.

Lovely jubly. Hopefully.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值