Over a million developers have joined DZone.
Platinum Partner

Learning Android: Deploying application to phone from Mac OS X

· Java Zone

Discover how AppDynamics steps in to upgrade your performance game and prevent your enterprise from these top 10 Java performance problems, brought to you in partnership with AppDynamics.

I’ve been playing around a little bit today with writing an Android application and while for the majority of the time I’ve been deploying to an emulator I wanted to see what it’d look like on my phone.

The developer guide contains all the instructions on how to do this but unfortunately I’m blessed with the ability to skim over instructions which meant that my phone wasn’t getting picked up by the Android Debug Bridge.

We can check which devices have been detected by running the following command from wherever the SDK is installed:

/Users/mneedham/github/android/android-sdk-macosx/platform-tools/adb devices

This was initially returning no devices and reading Esau Silva’s blog made me realise that I’d failed to follow this instruction:

On the device, go to Settings > Applications > Development and enable USB debugging (on an Android 4.0 device, the setting is located in Settings > Developer options).

I’d assumed it was only necessary if I wanted to debug the application on my phone but it seems like you need to set it to be able to deploy in the first place.

And now my phone gets picked up and can be deployed to, yay!

/Users/mneedham/github/android/android-sdk-macosx/platform-tools/adb devices
List of devices attached 
3933C40945FA00EC	device

If it still doesn’t work then Esau Silva has some other ideas which I haven’t yet needed to try.


From http://www.markhneedham.com/blog/2011/12/23/learning-android-deploying-application-to-phone-from-mac-os-x/

The Java Zone is brought to you in partnership with AppDynamics. AppDynamics helps you gain the fundamentals behind application performance, and implement best practices so you can proactively analyze and act on performance problems as they arise, and more specifically with your Java applications. Start a Free Trial.


{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}