I just put Jelly Bean on my Nexus on Ubuntu

Here’s how. First, you need Android SDK installed and maybe this
Warning, this WILL clear your data.


wget http://dl.google.com/android/android-sdk_r20.0.3-linux.tgz
tar xvf  android-sdk_r20.0.3-linux.tgz
mkdir -p ~/opt/sdk
mv android-sdk-linux ~/opt/sdk/android-sdk
export PATH= /home/abc/opt/sdk/android-sdk/platform-tools
fastboot devices

Your device, connected via USB and with debugging enabled, should be listed.

cd ~/downloads/
wget https://dl.google.com/dl/android/aosp/yakju-imm76i-factory-8001e72f.tgz
tar -xzf yakju-imm76i-factory-8001e72f.tgz
cd yakju-imm76i
sudo fastboot oem unlock
sudo ./flash-all.sh

wait, wait, boom, works 😀

sudo fastboot oem lock

Debugging NetBeans RCP from IntelliJ

Netbeans rocks, especially as it becomes more and more like IntelliJ 😉

The story: NB RCP app, converted to use maven, developed mostly in IntelliJ (with the exception of GUI screens, which go through Matisse).
It’s runnable, it works, but there’s one glitch: debugging only seems to work from inside NetBeans. Should be easy, nbm plugin manual tells what to do here.
Let’s create a Run Configuration, add params, should work, right?

 and 

And it works! Well, almost, or up to the point where VM complains and quits.

1
2
3
4
5
6
7
8
[INFO] --- nbm-maven-plugin:3.7:run-platform (default-cli) @ application ---
[INFO] Executing:
/bin/sh -c /Users/ags/vcs/work/trololo-code/client/application/target/trololo_client/bin/trololo_client
--userdir /Users/ags/vcs/work/trololo-code/client/application/target/userdir
-J-Dnetbeans.logger.console=true -J-ea --branding trololo_client
-J-Xdebug -J-Xnoagent -J-Xrunjdwp:transport=dt_socket,suspend=n,server=n,address=8888
[INFO] Invalid memory access of location 0x0 rip=0x7fff958af540
[INFO] ERROR: transport error 202: connect failed: Connection refused

But it works under NetBeans, and it uses the same parameters and it’s Java and.. WTF?!
What does netbeans exactly do for debugging?


NetBeans: JPDA Listening Start...
JPDA Address: ags-mbpro.local:54019
Port:54019
cd /Users/ags/vcs/work/trololo-code/client/application;
JAVA_HOME=/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
"/Applications/NetBeans/NetBeans 7.2.app/Contents/Resources/NetBeans/java/maven/bin/mvn"
-Djpda.listen=true
"-Dnetbeans.run.params.ide=-J-Xdebug -J-Xrunjdwp:transport=dt_socket,suspend=n,server=n,address=54019"
-Djpda.address=54019 nbm:cluster-app nbm:run-platform

Of course our parameters are correct, running the same command from the command line doesn’t give anything. So the glitch must somewhere else… or. It’s right here, in the very beginning!

NetBeans: JPDA Listening Start...
JPDA Address: ags-mbpro.local:54019
Port:54019

NetBeans starts listening on for debugger BEFORE it runs RCP. Idea can do that too, but by default it wants to connect to a socket. So the easiest way it change it to Listen and start before running the app (meh).

Or change server to y. That’s my preferred way (at least since quite some time).

-J-Xdebug -J-Xnoagent -J-Xrunjdwp:transport=dt_socket,suspend=n,server=y,address=8888