Setting up a Device for Development
With an Android-powered device, you can develop and debug your Android applications just as you would on the emulator. There are just a few things to do before you can start.
- Declare your application as "debuggable" in your Android Manifest.
In Eclipse, you can do this from the Application tab when viewing the Manifest (on the right side, set Debuggable to true). Otherwise, in theAndroidManifest.xml
file, add android:debuggable="true"
to the <application>
element.
- Turn on "USB Debugging" on your device.
On the device, go to the home screen, press MENU, select Applications > Development, then enable USB debugging.
- Setup your system to detect your device.
- If you're developing on Windows, you need to install a USB driver for adb. Follow the steps below for Installing the WinUsb Driver.
- 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 rules file:
- Login as root and create this file:
/etc/udev/rules.d/51-android.rules
.
For Gusty/Hardy, edit the file to read:
SUBSYSTEM=="usb", SYSFS{idVendor}=="0bb4", MODE="0666"(我用了这个有效)
For Dapper, edit the file to read:
SUBSYSTEM=="usb_device", SYSFS{idVendor}=="0bb4", MODE="0666"
- Now execute:
chmod a+rx /etc/udev/rules.d/51-android.rules
You can verify that your device is connected by executing adb devices
from your SDK tools/ directory. If connected, you'll see the device name listed as a "device."
If using Eclipse, select run or debug as usual. You will be presented with a Device Chooser dialog that lists the available emulator(s) and connected device(s). Select the device to install and run the application there.
If using the Android Debug Bridge (adb), you can issue commands with the -d
flag to target your connected device.
分享到:
相关推荐
The material also covers setting up Linux for mobile application development, the difference between developing on a mobile Internet device and a regular desktop environment, step-by-step tutorials, ...
Show my location app: Creating a map project, setting required permissions, accessing GPS device and showing real time location on the map. 6. S.O.S. sender app: Adding SMS functionality, setting ...
- Guidance on setting up a development environment suitable for writing device drivers, including tools, compilers, and debugging utilities. - Instructions on configuring the kernel for development ...
This setting controls whether a `PkgInfo` file should be generated for the application. The `PkgInfo` file contains metadata about the application, such as its type and subtype, which can be useful ...
Beginning Windows Phone 7 Development starts with the basics, walking you through the process of downloading and setting up the right development tools, including Visual Studio, Expression Blend, ...
With the Apple Watch being widely regarded as a success, all eyes are now on Google to provide a similar device for its users. Keep your skills ahead of the competition and be one of the first to ...
If you are a web developer who wants to build hybrid mobile app development using the Ionic framework, then this comprehensive course is best-suited for you. What You Will Learn Get to know about ...
We also cover the setting up of the development environment and create a simple Hello World application for your device and emulators. Chapter 2, Looking Good – The Graphical Interface, takes a ...
Android Studio offers a myriad of tools for developers such as enhanced intellisense and device emulation. This book provides a quick and easy to read format; introduces the reader to these key tools...
the book begins with an overview of the Mobile Linux landscape and then moves through setting up, developing, packaging and building a distribution for a mobile device. ,解压密码 share.weimo.info
What You Will Learn Install and configure Android SDK and ADB Analyze Android Permission Model using ADB and bypass Android Lock Screen Protection Set up the iOS Development Environment - Xcode and ...
2. Setting up an Android Studio Development Environment 3. Creating an Example Android App in Android Studio 4reating an sngdroid vurtual bevice tsvb in Android tudlo 6. ATouroftheAndroid studio user ...
Chapter 2 : Call Me, Text Me Setting Up Your Device Creating a Project Creating the Application Descriptor Writing the Code Packaging Your Application As an APK File and Installing It on the Device ...