Thursday, February 10, 2011

Android development cheatsheet


Here is a list of commands I find useful when developing applications. Do add to comments any commands that you use and find useful. I'll update accordingly. Also, I would be interested if anyone has any android UI related cheat sheets :)


android
-    Create/delete/view Android Virtual Devices
-    Create/update projects
-    Update the SDK with new platforms, addons and docs.

android list target
android list avd
android --help
android create avd –n <avd_name> -t <target_ID> -c <size>[K|M]
android create project --target <target_ID> --name <prjname> --path <where>
                       --activity <activityname> --package <package_namespace>

android update project [--name|-n] <prjname> [--target|-t] <target_ID>
                       [--path|-p] <thepath_to_prj>

android create lib-project --target <target_ID> --name <prjname> --path <where> 
                           --package <package_namespace>

adb
adb [-d|-e] install <path_to_your_bin>.apk
adb push <local> <remote>    - copy file/dir to device
adb pull <remote> [<local>]  - copy file/dir from device
e.g : adb push foo.txt /sdcard/foo.txt
adb shell
adb devices
adb –s emulator-5554 shell

#sqlite3 /data/data/com.example.google.rss.rssexample/databases/rssitems.db
sqlite>.exit
adb logcat [<option> … [<filter-spec>] …
[V – Verbose, D – Debug, I – Info, W – Warning, E – Error, F – Fatal, S – Silent]

adb logcat <tag1>:<priority1> …..
e.g. : adb logcat ActivityMgr:I MyApp:D *:S

others 
mksdcard [-l label] <size>[K|M] <file>
emulator –avd <avd_name> –sdcard <file>
telnet localhost <emulator-port>


#From inside telnet:


- sms send <sender phone number> <text message>
- geo fix <longitude> <latitude> [<altitude>]