Showing posts with label android. Show all posts
Showing posts with label android. Show all posts

Sunday, October 24, 2010

android tool box

Emulator:
emulator -cpu-delay 0 -no-boot-anim -cache ./cache  -avd froyo


adb log view:
adb -e logcat

(-d if device, -s xxxx if multiple emulators/devices)

and for the code:
import android.util.Log;
[...]
Log.d(TAG, sb.toString());


controling the emulator (will never understand why it's not implemented in the shell...)
telnet localhost 5554
# gsm call 5555
# sms...

android build on device and emulator

`ant install` will freak out and die if you have more then one device in `adb devices`

but it has an option in its rules called adb.device.arg, which is not really an adb device arg, but more like an adb arg. so you can pass any argument to adb there.

in my case since i only have one emulator and one device simply passing "-d" for device or "-e" for emulator solves it. you can also pass "-s id_of_device_or_emulator"

since i'm clueless to ant i will use the easiest solution and pass that as an argument every single time:

ant install -Dadb.device.arg="-d"


if you are clever than me, pls comment on how i create a simple `ant installdevice` rule that simply sets that var and then run the install target, please.

Android USB debugging in linux

get the device vendor string:
$ lsusb
...
Bus 001 Device 005: ID 18d1:4e12 Google Inc. Nexus One Phone (Debug)
...


add a rule to udev to allow read/write

# cat SUBSYSTEM=="usb", SYSFS{idVendor}=="18d1", MODE="0666" > 
/etc/udev/rules.d/51-android.rules


disconnect and reconnect the usb cable. done.