In a moment not quite unlike hearing your programming lecturer has written a debugger for debugging a debugger, I decided to have a delve into Swing and AWT to produce a small tool that would enable me to make better use of Eclipse and the Android SDK’s features.
When I test an Android app, I can see the phone’s logcat of events via ADB (Android Debug Bridge). In the past, this has involved using the Android Dropbox app to download the .apk file generated by Eclipse whenever I click ‘Run’ or ‘Debug’ onto the phone and installing it. For every revision. This didn’t annoy me too much, because I had the Android SDK’s Virtual Device Emulator to test apps. This emulator is very slow however, so I only used it for testing for
NullPointerExceptions, which would render the time spent installing a revision via Dropbox a waste of time.
I have recently learned that I can run a new revision directly on the phone wirelessly by using
cmd at the Windows Run prompt, then using
adb connect address. After doing this, the phone shows up in Eclipse’s DDMS perspective, including the logcat!
Therefore, the only logical conclusion is to make a Java application that can do this for me. Presenting the latest in SELNP (Slightly Enhanced Late Night Productivity) technology, ‘ADB Connect’!
It basically runs the command prompt command for me. Useful, and saves a minute or two. I learned a good deal about Swing and AWT doing it, so time well spent for future endeavours.