Debugging straight from your phone
One of the main reasons people (should) stay away from mobile web development is that it’s very nasty to debug. You often have to reinstall your app, managing your cache is somehow complicated and there’s no real nice way of determing what’s going on with your custom widgets. On top of all that, you have to somehow figure all of this out for three zillion different devices and platforms.
To help our fellow custom widget developers, we’re introducing a new feature today; mobile debugging. We understand that it’s a nuisance having to develop for three platforms, so we’ve come up with a uniform way to debug a Mendix app, no matter where it runs.
In order to debug your app you’ll need two things:
- weinre installed on your workstation
- the Mendix Developer App (v1.1) installed on the phone you’re developing on
Weinre is easily installed via npm:
npm install -g weinre@latest
After that you’ll have to start up weinre:
weinre --boundHost <yourIP> --httpPort 9090
where <yourIP> is your workstation’s IP address. This should be the same IP address that you see in your history when you visit your app from the Developer App. Examples are 10.0.0.1 or 192.168.1.1
It’s important to pass both these arguments because weinre listens to 8080 by default (which is the same as the default Mendix runtime port) and only on localhost, which your phone won’t be able to access.
After that you’re all set to connect your Mendix Developer App to weinre. You can click on the gear icon in the top right of the homescreen to configure your debugger. You should fill in the same IP and port that you used to start weinre: http://<yourip>:9090 is probably what you want.
Once your phone is connected you can open the same link (http://<yourip>:9090) in the browser on your desktop to view and debug your app.
Happy debugging and let us know what you think in the comments!