String id = Secure.getString(getContentResolver(), Secure.ANDROID_ID);
As far as Settings.Secure.ANDROID_ID goes, this should do the trick:
adb shell sqlite3 /data/data/com.android.providers.settings/databases/settings.db "UPDATE secure SET value='newid' WHERE name='android_id'"
Where newid is usually the 16 hex digit code (i.e. don't append "Android_" to it). I only tried this on the emulator. I imagine a real phone would need to be rooted first.