尽管插入 USB 并打开 USB 调试,Android 设备仍显示离线

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/11485878/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-20 07:48:34  来源:igfitidea点击:

Android device appears offline despite plugging in USB and switching on USB debugging

androidandroid-emulator

提问by user1210233

I'm trying to run my Android app on a Samsung Galaxy Ace. Despite plugging in the USB and enabling debugging, when I try to run the app, Eclipse prints out a message saying

我正在尝试在三星 Galaxy Ace 上运行我的 Android 应用程序。尽管插入了 USB 并启用了调试,但当我尝试运行该应用程序时,Eclipse 会打印出一条消息说

[2012-07-14 22:56:19 - Cricket] Android Launch!
[2012-07-14 22:56:19 - Cricket] adb is running normally.
[2012-07-14 22:56:19 - Cricket] Performing nikhil.android.cricket.MainActivity activity launch
[2012-07-14 22:56:19 - Cricket] No active compatible AVD's or devices found. Relaunch this configuration                     after connecting a device or starting an AVD.

I'd like to add that I've been trying a lot but am unable to do anything. I tried killing adb and restarting it. Same error. Also, I am able to run it instantly when I connect my friend's Samsung Galaxy Note. But it won't run on my Samsung Galaxy Ace. I'd appreciate any help I can get on this.

我想补充一点,我一直在尝试很多,但什么也做不了。我尝试杀死 adb 并重新启动它。同样的错误。此外,当我连接我朋友的三星 Galaxy Note 时,我可以立即运行它。但它不会在我的三星 Galaxy Ace 上运行。我很感激我能得到的任何帮助。

回答by mobile

Go to DDMS in Eclipse IDE.

转到 Eclipse IDE 中的 DDMS。

There is one menu: Expand that menu and select the Reset adboption.

有一个菜单:展开该菜单并选择“重置 adb”选项。

Wait for a few seconds, it will reset your selected ADB device.

等待几秒钟,它将重置您选择的 ADB 设备。

回答by UMAR

Just reboot the phone, it will solve your issue. no need to adb restart is required.

只需重新启动手机,它就会解决您的问题。不需要 adb restart 。

回答by António Almeida

Windows:

视窗:

Start Menu button> type:cmd

Start Menu button>类型:cmd

Problem, the device is offline:

问题,设备离线:

adb devices

adb devices

List of devices attached
07952b41offline

List of devices attached
07952b41离线

  1. adb kill-server
  2. adb start-server(Wait some seconds ...)
  3. adb devices
  1. adb kill-server
  2. adb start-server(等几秒钟……)
  3. adb devices

List of devices attached
07952b41device

List of devices attached
07952b41设备

回答by nikos.t

You might have to change the active USB computer connectionsetting. I had the same problem while running a Beanstalk custom rom based on Android 4.3. It was solved by switching from the default Media device (MTP)to Mass storage. The device was then automatically recognized by eclipse.

您可能需要更改活动的USB 计算机连接设置。我在运行基于 Android 4.3 的 Beanstalk 自定义 rom 时遇到了同样的问题。它是通过从默认媒体设备 (MTP)切换到大容量存储来解决的。该设备随后被 eclipse 自动识别。

回答by NameSpace

I tried everything in this list to no avail, with a Samsung galaxy 5 (4.4.2). The only way I got it to work finally was to select the option to "revoke USB debugging authorization" which caused my phone to prompt me to authorize my computer to debug with it -- only then did it appear "online."

我尝试了此列表中的所有内容,但无济于事,使用的是 Samsung Galaxy 5 (4.4.2)。我最终让它工作的唯一方法是选择“撤销 USB 调试授权”的选项,这导致我的手机提示我授权我的计算机使用它进行调试——然后它才出现“在线”。

Installing the newer newer google / samsung drivers with the enhanced usb debugging security seems not to trigger an authorization prompt by itself. Seems you need to help it along by revoking all previous authorizations even on a new phone.

安装具有增强的 USB 调试安全性的较新的 google/samsung 驱动程序本身似乎不会触发授权提示。似乎您需要通过撤销所有以前的授权来帮助它,即使是在新手机上也是如此。

回答by akifusenet

I had this problem with my new updated to Kitkat GT-N7100. I tried everything

我新升级到 Kitkat GT-N7100 时遇到了这个问题。我尝试了一切

  • unhidden developer menu & enable USB debugging
  • reset ADB
  • installing latest USB device driver
  • installing laest KIES
  • 隐藏的开发者菜单并启用 USB 调试
  • 重置亚行
  • 安装最新的 USB 设备驱动程序
  • 安装最新的 KIES

none worked.

没有一个工作。

Device always looked offline in ddms.

设备在 ddms 中始终处于离线状态。

If you tried all this and still no use then try this:

如果您尝试了所有这些但仍然没有用,请尝试以下操作:

http://www.droidextra.org/2013/12/24/solved-fix-adb-devices-offline-100-working.html

http://www.droidextra.org/2013/12/24/solved-fix-adb-devices-offline-100-working.html

It worked for me.

它对我有用。

Akif,

阿基夫,

回答by Faakhir

To install the Android USB driver on Windows 7 for the first time:

首次在 Windows 7 上安装 Android USB 驱动程序:

  1. Connect your Android-powered device to your computer's USB port.
  2. Right-click on Computer from your desktop or Windows Explorer, and select Manage.
  3. Select Devices in the left pane.
  4. Locate and expand Other device in the right pane.
  5. Right-click the device name (such as Nexus S) and select Update Driver Software. This will launch the Hardware Update Wizard.
  6. Select Browse my computer for driver software and click Next.
  7. Click Browse and locate the USB driver folder. (The Google USB Driver is located in \extras\google\usb_driver.)
  8. Click Next to install the driver. Or, to upgrade an existing Android USB driver on Windows 7 with the new driver:
  1. 将 Android 设备连接到计算机的 USB 端口。
  2. 在桌面或 Windows 资源管理器中右键单击“计算机”,然后选择“管理”。
  3. 在左侧窗格中选择设备。
  4. 在右侧窗格中找到并展开其他设备。
  5. 右键单击设备名称(例如 Nexus S)并选择更新驱动程序软件。这将启动硬件更新向导。
  6. 选择浏览我的计算机以查找驱动程序软件,然后单击下一步。
  7. 单击浏览并找到 USB 驱动程序文件夹。(Google USB 驱动程序位于 \extras\google\usb_driver 中。)
  8. 单击下一步安装驱动程序。或者,要使用新驱动程序在 Windows 7 上升级现有的 Android USB 驱动程序:

回答by Vikas

I also faced the same problem with Samsung Google nexus. I use Mac and I followed these steps to solve my problem

我也遇到了与三星谷歌 nexus 相同的问题。我使用 Mac 并按照以下步骤解决了我的问题

If you are developing on eclipse skip step 2

如果您在 Eclipse 上开发,请跳过第 2 步

1: Enable USB debugging on your phone.
for lesser than 3.2 version go to Settings->Applications-> development
for versions 4.0 and higher its in Settings->development
for 4.2 its hidden. Go to Settings->about phone and tap build number 7 times (message will appear that you are a developer now)

1:在手机上开启USB调试。
对于低于 3.2 的版本,请转到设置->应用程序->
4.0 及更高版本的开发,在设置->
4.2 的开发中隐藏。转到设置->关于手机并点击版本号7次(将显示您现在是开发人员的消息)

2: In your manifest file add android:debuggable="true" to the application element

2:在您的清单文件中,将 android:debuggable="true" 添加到应用程序元素

回答by Smily

if your Samsung mobile driver not install successfullythen also this problem may occur

如果您的三星移动驱动程序未成功安装,则也可能会出现此问题

so download driver from following link and install it in your PC link

所以从以下链接下载驱动程序并将其安装在您的 PC链接中

回答by love2script12

In AndroidManifest.xml, see that your minSdkVersion and targetSdkVersion match your device.

在 AndroidManifest.xml 中,查看您的 minSdkVersion 和 targetSdkVersion 是否与您的设备匹配。