How to debug an Android app

Share your advanced knowledge/code with the community.
Fred
Site Admin
Posts: 1506
Joined: Mon Feb 24, 2014 10:51 am

How to debug an Android app

Post by Fred »

Hello everyone,

Here is a quick guide to properly debug an Android app, as it can be sometimes difficult to know what happen.

1) You will need Chrome

2) Connect your device and launch the APK on it

2) Enter this URL in Chrome:

Code: Select all

chrome://inspect/#devices
It should list your running APK (must be in debug mode, you can't connect to release APK). Click on 'inspect'.

Then you can reload the main page from Chrome and take a look to the 'console' or 'network' tab to see if something odd happen.

Happy bug hunting :)
IdeasVacuum
Posts: 143
Joined: Tue Feb 25, 2014 1:27 pm

Re: How to debug an Android app

Post by IdeasVacuum »

A very useful tool Fred, good tip. 8-)
Fangles
Posts: 11
Joined: Sat Jan 28, 2017 4:25 am

Re: How to debug an Android app

Post by Fangles »

Is there any way to push an app wirelessy to the device?

I currently have a wireless charging receiver plugged in under the molbile case and can't keep just ripping it out to compile and send.

(I need some help to write a simple happy birthday app for my wife as well:):):):)
IdeasVacuum
Posts: 143
Joined: Tue Feb 25, 2014 1:27 pm

Re: How to debug an Android app

Post by IdeasVacuum »

Hi Fangles
There must be a way but I don't know how to do it. When my phone is connected to the PC via USB, it is charging anyway, so not a problem here.

Other possibilities:
Save the APK to an Android USB stick;
Upload the APK file to your website or virtual drive/cloud and then download it to your phone via the browser (phone in debug mode).
Fangles
Posts: 11
Joined: Sat Jan 28, 2017 4:25 am

Re: How to debug an Android app

Post by Fangles »

IdeasVacuum, there's no problem to upload an apk wirelessy to the phone, I have any number of utilities to do that.

But the problem is that when you compile an APK, spiderbasic expects the phone to be connected via usb and it totally hung, needing task manager to kill it. And it didn't create the apk.

Strangely enough, the next time I relaunched spiderbasic and did that (exact same procedure above) again, this time it didn't hang and DID create the apk.

What a difference in file size this version makes too!!!

My old spiderbasic test code was 24.4 meg in size.
The latest spiderbasic compiles it as 1.52 meg. Yippeee!

Too late to make a happy birthday app for my wife's phone, it's today!! (And I don't yet know what I am doing)

Whoops!! I spoke too soon. My phone's package manager says the apk is corrupt. No idea how, it's just a straight compile and works in the browser. Damnit.
Fred
Site Admin
Posts: 1506
Joined: Mon Feb 24, 2014 10:51 am

Re: How to debug an Android app

Post by Fred »

Be sure to sign it if you don't compile in debug
Post Reply