Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

Posts: 12
Registered: ‎02-17-2012
My Device: developer
My Carrier: developer

Remote Debug on the Alpha Simulator

I setup remote debugging with the BB10 simulator this morning and I found the documentation for that just  incoherent, and incomplete enough. That I thought I'd make a quick note here about some of the steps.

- First you will want make you *.bar file with the debugging flag tuned on. It's the -d option when one invokes bbwp and the command looks something like  

bbwp C:/Users/Administrator/workspace/mobileweb/pkg/myapp.zip -d -o C:/Users/Administrator/workspace/mobileweb/rim. The bbwp command will give warnings about debug tokens not being available. You dont need debug tokens to debug on the simulator however so just ignore the warnings.


- with that done one can deploy to the alpha simulator with commands like:

cd /home/marco/workspace/mobileweb/bestparking/build/blackberry/SDK-
java -Xmx512M -jar BarDeploy.jar -installApp -device -package /home/marco/workspace/mobileweb/rim/simulator/myapp.bar

Your simulator addess and directory paths will naturally vary. Get the simulator address from the bottom of the simulator window.


- Next boot your app in the simulator and a dialog box titled "Web Inspector Enabled", will pop up along with your apps home screen. The documenation implies that this dialog will present a url which you can connect to with webkit browser for debugging, but if your experience follows mine you will notice that the dialog contents are blank.


- To find the remote address to connect your browser to, telnet into the alpha simulator using the address at the bottom to the simulator screen. For me this is

> telnet

Enter the username: devuser and pasword: devuser to connect. Then from the command line enter the command

> netstat

and you will get output  like:

Proto Recv-Q Send-Q  Local Address          Foreign Address        State
tcp        0      0     ESTABLISHED
tcp        0      0   mia04s05-in-f15..http  CLOSE_WAIT
tcp        0      0     CLOSE_WAIT
tcp        0      0   nuq04s09-in-f4.1.http  CLOSE_WAIT
tcp        0      0   nuq04s07-in-f15..http  CLOSE_WAIT
tcp        0      0   nuq04s07-in-f15..http  CLOSE_WAIT
tcp        0      0   pd-in-f95.1e100..http  CLOSE_WAIT
tcp        0      0  *.1337                 *.*                    LISTEN
tcp        0      0   pb-in-f193.1e100.https ESTABLISHED
tcp        0      0   *.*                    LISTEN
tcp        0      0    *.*                    LISTEN
tcp        0      0  *.4455                 *.*                    LISTEN
tcp        0      0  *.11811                *.*                    LISTEN


In my particular case the debugging port is listed by the line

tcp        0      0  *.1337                 *.*                    LISTEN

The port on your simulator may vary but it will have the same general format. Use the format guide and experiment with your choices.


- Lastly, with a port, bring up a browser like chrome and, in the address bar, type in the simulator address and the port number that you picked off of the netstat output. For me I type the address:

That will get you to a home page which will present 3 or more applications to debug --- just click on your application  in the list and your remote debug session will start up.


- The only other thing Ill note Is that if you are debugging javascript you are probably going to want to use uncompressed javascript. The chrome developer tools can uncompress js for debug work but my experience here is that something about the BB simulator prevents setting breakpoints properly in compressed code.


So there you go. Debugging is fundamental enough to product that we shouldnt have to figure it out for ourselves but until proper documenation appears --- that's what I have found.



Please use plain text.
Posts: 17
Registered: ‎11-04-2010
My Device: Not Specified

Re: Remote Debug on the Alpha Simulator

I'm surprised that nobody else has said it yet.  THANK YOU.  I find the poor documentation for something so fundamental to be very, very frustrating indeed.


Please use plain text.