Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I view Android LogCat output from an exported APK running on a physical device?

When I run my Android app using the Run -> Run menu option in Eclipse, the app launches on my phone and while it's running I'm able to view the log output in LogCat within Eclipse.

When I export my app, copy the .APK onto the phone, install it from the APK, and run the installed app, I don't see any output in LogCat.

Is there a way to view that log output?

Context:

I'm in the process of implementing in-app purchases. I think I have it working, and when I try using the in-app purchases from within the app if it's being launched on the phone via Eclipse's Run menu, it activates the Google Play store but I get an error that says "This version of the application is not configured for billing through Google Play".

After some googling I found that this error gets thrown because the APK needs to have a signature that matches the APK I've uploaded to the developer console in order for the in-app billing to work, and running from Eclipse's Run menu doesn't provide that signature.

So I've tried installing the signed APK that matches the one I've uploaded to the developer console and now when I try to use the in-app billing from within the app, nothing happens at all. It doesn't seem to even try to launch the Google Play store like it does when run through Eclipse's Run menu.

So basically I need to see what kind of error messages it's outputting when I try to use the in-app billing specifically from the exported, signed APK.

like image 494
1337ingDisorder Avatar asked Jun 21 '15 07:06

1337ingDisorder


People also ask

How do I view the contents of an APK file in Android?

Viewing the contents of an APK file: Since APK files come in compressed ZIP format, any ZIP decompression tool can open it. So, for viewing the contents of an APK file, all you have to do is rename its extension to . zip and open it. Or, you can open it directly through an open dialogue box of a zip application.


2 Answers

Try adb logcat from the console or cmd, which will give you all the logs of the device.

Here's a small tutorial: http://forum.xda-developers.com/showthread.php?t=1726238 and official docs: http://developer.android.com/tools/help/logcat.html

If your device is rooted, you can also try this one: https://play.google.com/store/apps/details?id=com.nolanlawson.logcat

like image 193
Sazid Avatar answered Nov 14 '22 23:11

Sazid


  1. Install the app https://play.google.com/store/apps/details?id=org.jtb.alogcat to view the log directly in your phone.
  2. Use adb logcat
  3. Use DDMS and click on your app thread.
like image 32
thuongle Avatar answered Nov 15 '22 00:11

thuongle