开发者

How to run my android app on a real tablet device?

开发者 https://www.devze.com 2023-03-16 16:11 出处:网络
I use eclipse + ADT (andoid development tool) plugin to develop my android application. I know during my development, I can run my application either on an emulator, or an android phone device(with d

I use eclipse + ADT (andoid development tool) plugin to develop my android application.

I know during my development, I can run my application either on an emulator, or an android phone device(with data cable connected to my laptop).

BUT, now, I would like to run my app开发者_StackOverflow社区lication on a android Tablet(ZTE brand) during my development. How can I run it on the tablet?? I mean the tablet has no data cable to connect to my laptop, but only bluetooth.

  • What I need to configure on eclispe?
  • Can I just use bluetooth to connect the device, and trigger the application to run from eclipse?
  • How to run my application on the tablet during development on eclipse?


Perhaps this question could help. It discusses how you can connect to adb through Wi-Fi.


I've found dropbox to be a great way to distribute test versions of your apk. Make sure you have the setting turned on for non-market sources. Then just pull it up from within dropbox on your device.


if there is no usb-cable you cannot debug yor application on the tablet.

you can only export the app with eclipse and install the apk on the tablet to see how the application looks like. But there is no debugging over bluetooth


As long as your device can install apps from non-market sources, you can simply put your APK file somewhere accessible to a web browser, then browse to it from the device, which should cause it to be downloaded. Once it's downloaded, selecting it (using a file explorer app) will cause it to be installed.

You can't debug this way, but if you have something like aLogCat loaded you can view your app's log messages.


With an Android-powered device, you can develop and debug your Android applications just as you would on the emulator. Before you can start, there are just a few things to do:

Declare your application as "debuggable" in your Android Manifest. When using Eclipse, you can skip this step, because running your app directly from the Eclipse IDE automatically enables debugging. In the AndroidManifest.xml file, add android:debuggable="true" to the element. Note: If you manually enable debugging in the manifest file, be sure to disable it before you build for release (your published application should usually not be debuggable). Enable USB debugging on your device. On most devices running Android 3.2 or older, you can find the option under Settings > Applications > Development. On Android 4.0 and newer, it's in Settings > Developer options. Note: On Android 4.2 and newer, Developer options is hidden by default. To make it available, go to Settings > About phone and tap Build number seven times. Return to the previous screen to find Developer options. Set up your system to detect your device. If you're developing on Windows, you need to install a USB driver for adb. For an installation guide and links to OEM drivers, see the OEM USB Drivers document. If you're developing on Mac OS X, it just works. Skip this step. 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, below. 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 Note: When you connect a device running Android 4.2.2 or higher to your computer, the system shows a dialog asking whether to accept an RSA key that allows debugging through this computer. This security mechanism protects user devices because it ensures that USB debugging and other adb commands cannot be executed unless you're able to unlock the device and acknowledge the dialog. This requires that you have adb version 1.0.31 (available with SDK Platform-tools r16.0.1 and higher) in order to debug on a device running Android 4.2.2 or higher.

When plugged in over USB, you can verify that your device is connected by executing adb devices from your SDK platform-tools/ directory. If connected, you'll see the device name listed as a "device."

If using Eclipse, run or debug your application as usual. You will be presented with a Device Chooser dialog that lists the available emulator(s) and connected device(s). Select the device upon which you want to install and run the application.

If using the Android Debug Bridge (adb), you can issue commands with the -d flag to target your connected device.

Installing a USB Driver

First, find the appropriate driver for your device from the OEM drivers table below.

Once you've downloaded your USB driver, follow the instructions below to install or upgrade the driver, based on your version of Windows and whether you're installing for the first time or upgrading an existing driver.

Tip: When you finish the USB driver installation, see Using Hardware Devices for other important information about using an Android-powered device for development.

Windows 7 Windows XP Windows Vista Caution: You may make changes to android_winusb.inf file found inside usb_driver\ (for example, to add support for other devices), however, this will lead to security warnings when you install or upgrade the driver. Making any other changes to the driver files may break the installation process.

Windows 7

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

Connect your Android-powered device to your computer's USB port. Right-click on Computer from your desktop or Windows Explorer, and select Manage. Select Devices in the left pane. Locate and expand Other device in the right pane. Right-click the device name (such as Nexus S) and select Update Driver Software. This will launch the Hardware Update Wizard. Select Browse my computer for driver software and click Next. Click Browse and locate the USB driver folder. (The Google USB Driver is located in \extras\google\usb_driver.) Click Next to install the driver. Or, to upgrade an existing Android USB driver on Windows 7 with the new driver:

Connect your Android-powered device to your computer's USB port. Right-click on Computer from your desktop or Windows Explorer, and select Manage. Select Device Manager in the left pane of the Computer Management window. Locate and expand Android Phone in the right pane. Right-click Android Composite ADB Interface and select Update Driver. This will launch the Hardware Update Wizard. Select Install from a list or specific location and click Next. Select Search for the best driver in these locations; un-check Search removable media; and check Include this location in the search. Click Browse and locate the USB driver folder. (The Google USB Driver is located in \extras\google\usb_driver.) Click Next to upgrade the driver. Windows XP

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

Connect your Android-powered device to your computer's USB port. Windows will detect the device and launch the Hardware Update Wizard. Select Install from a list or specific location and click Next. Select Search for the best driver in these locations; un-check Search removable media; and check Include this location in the search. Click Browse and locate the USB driver folder. (The Google USB Driver is located in \extras\google\usb_driver.) Click Next to install the driver. Or, to upgrade an existing Android USB driver on Windows XP with the new driver:

Connect your Android-powered device to your computer's USB port. Right-click on My Computer from your desktop or Windows Explorer, and select Manage. Select Device Manager in the left pane. Locate and expand Android Phone in the right pane. Right-click Android Composite ADB Interface and select Update Driver. This will launch the Hardware Update Wizard. Select Install from a list or specific location and click Next. Select Search for the best driver in these locations; un-check Search removable media; and check Include this location in the search. Click Browse and locate the USB driver folder. (The Google USB Driver is located in \extras\google\usb_driver.) Click Next to upgrade the driver. Windows Vista

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

Connect your Android-powered device to your computer's USB port. Windows will detect the device and launch the Found New Hardware wizard. Select Locate and install driver software. Select Don't search online. Select I don't have the disk. Show me other options. Select Browse my computer for driver software. Click Browse and locate the USB driver folder. (The Google USB Driver is located in \extras\google\usb_driver.) As long as you specified the exact location of the installation package, you may leave Include subfolders checked or unchecked—it doesn't matter. Click Next. Vista may prompt you to confirm the privilege elevation required for driver installation. Confirm it. When Vista asks if you'd like to install the Google ADB Interface device, click Install to install the driver. Or, to upgrade an existing Android USB driver on Windows Vista with the new driver:

Connect your Android-powered device to your computer's USB port. Right-click on Computer from your desktop or Windows Explorer, and select Manage. Select Device Manager in the left pane. Locate and expand ADB Interface in the right pane. Right-click on HTC Dream Composite ADB Interface, and select Update Driver Software. When Vista starts updating the driver, a prompt will ask how you want to search for the driver software. Select Browse my computer for driver software. Click Browse and locate the USB driver folder. (The Google USB Driver is located in \extras\google\usb_driver.) As long as you specified the exact location of the installation package, you may leave Include subfolders checked or unchecked—it doesn't matter. Click Next. Vista might prompt you to confirm the privilege elevation required for driver installation. Confirm it. When Vista asks if you'd like to install the Google ADB Interface device, click Install to upgrade the driver.

Links

Setting Up Device

USB Drivers

0

精彩评论

暂无评论...
验证码 换一张
取 消