IkLaN

IkLaN

Copas International

IkLaN

IkLaN

Sabtu, 22 Oktober 2016

USB Debug Connection Android


USB Debug Connection Android

Configuring Your Android* USB Debug Connection
By Paul F. (Intel), Added Thu, 06/09/2016 - 15:43

If you are having difficulties setting up your device for use with the Debug tab or the “Run My App” tool on the Develop tab, please first confirm that you have a good USB cable! Some USB cables function as "charging" cables, only, meaning they cannot be used to transmit data. You must use a cable that supports USB data transfers!
The Android USB debug driver must be installed on your Windows machine before you attempt any of the actions described below. Linux and OS X have the appropriate Android USB debug drivers already built-in and do not require an ADB debug driver installation step. See Installing the Android Debug Bridge (ADB) USB Driver on a Windows Computer if you do not have the ADB driver installed on your Windows machine or if this is the first time you are going to use your Android device with this Windows computer (you must go through the procedure described in the linked article for each new Android device you attach to your Windows machine).

If you are having trouble with adb on Linux, especially on a 64-bit Linux install, you may need to install the 32-bit Linux shared libraries. You can either install the entire 32-bit support libraries or just the libc6-i386 and lib32stdc++6 modules. On an Ubuntu/Debian system use the sudo apt-get install libc6-i386 lib32stdc++6 command to install the required libraries.

Also, some Linux machines may require configuration of udev rules before they will recognize your Android debug device over USB. See Special Instructions for Ubuntu and Other Linux Users for details.

If you have enabled the debug feature on your device (by following the instructions in this document) and can successfully "debug" a small sample app with the Debug tab, but are having trouble either getting your app to start when using the Debug tab or having trouble getting the debug console to start:

1) stop the debug session
2) select the Test tab
3) push the sync button on the Test tab
4) return to the Debug tab.

This sometimes resolves debug startup issues. It sometimes helps to start App Preview on your device before you start using the Debug tab. If these workarounds do not resolve the issue, you may have an Android USB debug driver problem. In that case, please follow the instructions provided in the second-half of this document.

Enabling your Android Device for Remote Debug over USB

If you see either of the following two messages in the Intel® XDK, when trying to use the Debug tab or the Run My App feature on the Develop tab, it means that your Android device is not being recognized over the USB connection by your workstation.



Confirm that your Android device is running Android 4.0 or higher:

Remote debug can only be used with Android 4.0 and higher version devices (debugging with Crosswalk 21 or higher requires an Android 4.1 or higher device). Android 2.x and 3.x devices do not support this feature.

Find the Settings > About device screen on your device.
Under Android version you will find the version of Android OS running on your device.
Confirm that your device is running Android 4.0 or higher (Android 4.1+ for Crosswalk 21+).
Make sure you have installed the latest version of Intel App Preview on your Android test device:

Scan this QR code with your Android device or search for Intel App Preview in the Google Play Store.



Verify that USB debugging is enabled on your test device:

Find the Settings > Developer options configuration screen on your Android device.
If Developer options is not visible, select Settings > About device and tap the Build number item seven times. Return to the Settings screen and Developer options should now be visible.
Enable the USB Debugging option from within Settings > Developer options. Enabling this function automatically launches remote debug mode on your Android device when a USB connection is made with your development system.
For reference, detailed instructions regarding setting up USB debugging on your Android device can be found under the section titled Set up your Android device on the Remote Debugging on Android with Chrome DevTools page in the Google Developers site.

Disconnect and reconnect the USB connection to your test device:

Disconnect the USB cable from your Android test device and your workstation.
Unlock your Android device’s home screen.
Reconnect the USB cable to your device and your workstation.
If you see an alert on your Android device requesting permission to “Allow USB debugging,” click OK. On some slower Android devices there may be a delay of five or more seconds before you see an “Allow USB debugging?” alert.


Check the “Always allow from this computer” box to avoid having to watch for this alert the next time you attach your Android device for remote USB debugging.

If you do not see the "Allow USB debugging" prompt (above) you may be able to force your Android device to show it by: 1) disabling the USB Debugging option in Settings > Developer options on your device and then 2) enabling the USB Debugging option in Settings > Developer options (that is, toggle the USB Debugging option on your Android device). Do this while your Android test device is attached to your workstation via USB and the Intel XDK is running.

If you see the following message in the Intel XDK on the Debug tab it is an indication that you may have missed the “Allow USB debugging?” message on your Android device when you attached your Android device to your workstation’s USB port (select the blue pull-down triangle to see the entire message):



If you do see the message above repeat the instructions in this section.

Confirm that your system can see your Android device:

You can confirm that your workstation recognizes and can communicate with the Android debug bridge (adb) over USB by performing the following test with your Chrome desktop browser (this test requires Chrome):

Confirm that USB debugging is enabled on your Android device (see the prior instructions).
Close the Intel XDK and kill any adb processes that are running on your workstation (search for "kill a process" if you need help).
Attach your Android device to a USB port on your workstation and answer “OK” to any USB debug alert message that appears when you attach your device (see the prior instructions).
Open the Chrome browser on your workstation and type “chrome://inspect” in your Chrome browser’s URL bar.


If your USB-connected Android device is recognized by Chrome it will show you the name of your device and it may also show you a list of debuggable browser tabs that are open on your Android device (as shown in the image above, debuggable tabs will only be listed if you have an instance of Chrome mobile browser with open tabs running on your Android device). You may also see a list of apps containing debuggable WebViews in this list (none are shown in this example screenshot).

Something similar to the following screen will be seen if this test fails:



Important: If the above test failed, try changing the USB connection mode of your device from a Media Device (MTP) connection to a Camera Device (PTP) connection and try it again. See this How-To Geek article for more information regarding Android MTP and PTP connection modes. Some devices do not explicitly give you an "MTP" or "PTP" connection option, instead they will give you the option to "enable access to files" on your Android device; enabling "access to files" on your device is equivalent to enabling MTP mode.

Special Instructions for Ubuntu and Other Linux Users

If you're developing on Ubuntu Linux, you need to add a udev rules file that contains a USB configuration for each type of device you want to use for development. In the rules file, each device manufacturer is identified by a unique vendor ID, as specified by the ATTR{idVendor} property. For a list of vendor IDs, see USB Vendor IDs. To set up device detection on Ubuntu Linux:

Log in as root and create this file: /etc/udev/rules.d/51-android.rules.
Use this format to add each vendor to the file:
SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", MODE="0666", GROUP="plugdev"
In this example, the vendor ID is for HTC. The MODE assignment specifies read/write permissions, and GROUP defines which Unix group owns the device node.
Note: The rule syntax may vary slightly depending on your environment. Consult the udev documentation for your system as needed. For an overview of rule syntax, see this guide to writing udev rules.
Now execute:
chmod a+r /etc/udev/rules.d/51-android.rules
The details above can also be found on the Android developers doc page titled Using Hardware Devices, in the Setting up a Device for Development section of that page.


Tidak ada komentar:

Posting Komentar

Terimakasih sudah berkunjung :D
Sukses selalu dan Salam Hormat :)
*)

W M Transfer

W M Transfer

IkLaN