Tag Archives: Android

Device Not Found Error from ADB on Mac OS X

Getting started with Android development on OS X? Is the debugger unable to see your Android phone via USB? I ran into a similar issue and solved it as follows.

In my case, when I would issue the “adb devices” command, I would get back “List of devices attached” and nothing afterward. Similarly, issuing the “adb usb” command would result in “error: device not found”.

As it turns out, the problem was due to a conflict between adb and EasyTether, a USB tethering app. Both wanted to use the USB port to communicate with the phone. If you also use EasyTether or EasyTether Pro, the instructions below will get you up and running. If you use a similar tethering app, this solution may also be helpful.

  1. In OS X, open the Terminal application
  2. Connect your Android device (phone, tablet, etc.) to the USB port
  3. Go to the Android SDK directory. In my case, it’s in ~/android-sdk-macosx/platform-tools
    $ cd ~/android-sdk-macosx/platform-tools
  4. Verify that the device and usb port aren’t available by executing the commands “adb devices” and “adb usb”
    $ ./adb devices
    List of devices attached
    $ ./adb usb
    error: device not found
  5. Now, it’s time to free the USB device. Go to the system extensions directory and unload the EasyTether kernel extension. If you’re using a different app, you’ll have to find out what kernel extension it uses on OS X
    $ cd /System/Library/Extensions/
    $ sudo kextunload EasyTetherUSBEthernet.kext
  6. Go back to the Android SDK directory (unless you have adb in your path) and kill the adb server, in case it’s still running$ cd -$ ./adb kill-server
  7. Finally, restart the adb server on the USB device and check that your device appears
    $ ./adb usb
    * daemon not running. starting it now on port 5037 *
    * daemon started successfully *
    restarting in USB mode
    $ ./adb devices
    List of devices attached
    5052D5808D6F00EC device

If you see your Android device listed, as shown in the output of the last step, above, then you’re in business. You should now be able to start an adb shell, install an apk, etc.

To restore EasyTether on OS X, go back to the system extensions directory and reinstall the kernel extension by running, “sudo kextload EasyTetherUSBEthernet.kext”, or just reboot.

Update 2015/01/28: cielavenir wrote a handy tool to load/unload the EasyTether kext. You can get it at https://github.com/cielavenir/EasyTetherLoader

Are you using a different tethering app and solved the issue? Post your success in the comments.

Missing Calendar Events after Android 2.2 Update on Samsung Epic

After upgrading the Samsung Epic 4G (SPH-D700) to Android 2.2 Froyo, did you find that all your synced Android calendar events disappeared? In my case, all the recurring calendar events were missing on the phone, but still appeared when I went to Google Calendar from my browser. Here are two ways to fix it.

Clear the cached calendar data

  1. From the Home screen, open the Menu and select Settings.
  2. Scroll down and select Applications, then Manage Applications.
  3. Select the Calendar Sync application.
  4. In the Storage section, click the Clear button.

Now, sync your Android calendar and all the events should come back. If they don’t, try the following fix.

Modify the missing events

If clearing the calendar cache, above, doesn’t work for you, then you can force the Android calendar data to update by modifying the contents of the missing events. Simply edit each event online in Google Calendar by changing the event name or other information about it. After modifying all the desired events, sync the calendar on the phone.

Which fix worked for you? Have another way to fix this problem? Post your findings in the comments.

Samsung Epic 4G Battery Life: Fixing Excessive Battery Consumption

Do you have a Samsung Epic 4G or other Android phone? Do you have to recharge your battery daily or more than once a day even when you’re hardly doing anything with it? That’s not normal. My Samsung Epic, when lightly used, only needs to be recharged every three to four days.

“Impossible!” you say. “These are powerful phones and they use up the battery faster.” That may be true if you’re talking on the phone, watching videos and playing Angry Birds on it all day long. However, many people are having to frequently recharge their phones even under light to no usage, which should not be happening.

“You must use task killers, Juice Defender, a special kernel or some extreme tools to get that kind of battery life.” Actually, I’ve tried some, but abandoned such measures. They’re not necessary. There are many well-known ways to conserve power such as turning off services you don’t need, checking for mail less often, dimming the screen, etc. These are certainly important and should be practiced. But, there’s more.

Despite these normal power conservation techniques, when the Samsung Epic starts to drain the battery, it does so at an alarming rate. Here’s a log of the battery level at approximately ten-minute intervals that I kept when mine recently started to suck the battery dry:

62% @ 11:37 pm
61% @ 11:45 pm
59% @ 11:58 pm
57% @ 12:10 pm
56% @ 12:17 pm
55% @ 12:27 pm
52% @ 12:37 pm
51% @ 12:47 pm
50% @ 12:57 pm
49% @ 1:07 am
48% @ 1:10 am
47% @ 1:20 am
45% @ 1:36 am
44% @ 1:50 am
43% @ 2:05 am

It’s draining the battery at a rate of about 10% per hour. This is with the phone’s screen, GPS, 3G/4G data, Wi-Fi, automatic updates, Bluetooth and sound turned off. No applications were running. In fact, during this period, I had more things turned off than I usually do.

It’s been documented at the Sprint Community forum and various blogs that the Samsung Epic can go into a mode where it will continuously search for the cellular network. I have encountered this and the usual fix is to turn on airplane mode for a few seconds and then turn it off again to reset the radio. Unfortunately, I found that this fix doesn’t always work. Even shutting down the phone completely and then turning airplane mode on and off doesn’t help.

In the two cases thus far, when the simple fix for this problem didn’t work, two things did. The first was turning on airplane mode overnight. The second was turning the phone completely off overnight. Here’s a short log of battery life after the overnight fix for the sudden battery consumption I logged above:

41% @ 8:33 am
41% @ 8:44 am
41% @ 8:49 am
41% @ 9:00 am
40% @ 9:01 am
40% @ 9:10 am
40% @ 9:20 am
40% @ 9:33 am
39% @ 9:41 am

As you can see, now the phone is only consuming 1-2% per hour, rather than 1% every 10 minutes. The screen was off, but 3D data was enabled and some services that I turned off during the excessive battery usage were running again since the phone had freshly booted. So, despite having more things turned on, the phone is back to normal and will last significantly longer than the 8-10 hours that many owners of the Samsung Epic are reporting online as “normal”.

Does this fix really require turning the phone off (or putting it into airplane mode) all night? At this time, I’m not sure how long it needs to stay in the off/airplane state. It definitely needs more than a few minutes, because I’ve tried that and it’s not enough. So, it’s somewhere between a few minutes and 6.5 hours.

Have you tried this fix? How long did you have to keep your phone off or in airplane mode to get it to behave? Post your experience in the comments.

Button to Turn on Epic 4G Keyboard Backlight

Many reviews of the Samsung Epic 4G (SPH-D700) Android phone fault it for the backlighting of the four shortcut buttons at the bottom of the phone. When the keyboard backlight times out (six seconds, by default), those touch-sensitive shortcut buttons are no longer visible at all. The area becomes completely black. As a result, you either have to memorize which location is Menu, Home, Back and Search, or increase the backlight’s timeout, which uses more battery power.

Well, there’s actually another solution. When the shortcut keys are not visible, simply press the camera shutter button, located at the bottom-right of the phone when held in portrait orientation. Et voila! The keyboard backlight turns on. Since the camera button is raised, it’s easy to find, even in the dark.

Have any other tips for the Epic 4G? Share them in the comments.