I have installed my android app in my device. But getting "Unfortunately, app has stopped."
How can I debug the installed app? Is it possible to debug the app directly installed in the device?
Since code is not available with me
You can't connect debugger to an application if it uses a release build type where all of the information necessary for debugging is stripped out
(true for apps from play market).
If you don't want to use a debugger but just to see logs you may see log in android studio or just by running adb logcat in terminal.
Android Studio 3.0 also has a feature of Profile and Debug Pre-built APKs but only if they were built with debugging enabled
Related
I have a Xamarin Android app. I have used ADB to make it a device owner. I have also set it up so it requests DeviceAdministrator privileges. When i try to run the app from visual studio it, using the same signing key it was created with, it fails on the deployment phase saying it cannot uninstall the application. I know that DeviceAdmin privileges keep the app from uninstalling, but how does one then push from Visual Studio to debug the application?
I am working on a Xamarin project (Visual Studio 2017). It's working fine in the emulator when run in Debug and Release mode but I am unable to run it in a real device as Visual Studio is not showing any attached device though device is already attached and also developer option and all necessary options are active.
I am also getting the following error when I try to make an APK and run it in a real device:
app not installed, package is corrupted
There can be several reasons for your issue that you don't see the device in the VS dropdown:
You have activated USB Debugging on your device but have not trusted the computer you're connecting to. Just try to deactivate and reactivate debugging. If a dialog appears that asks is you want to trust this computer, than this was your issue.
You have configured a minimum API Level / SDK Version for your app that is higher than the API Level of your device. So just check your Android version on your device and the version you've defined as minimum in your project settings
Regarding the "package corrupt" error, I can think of the following:
You have not signed your apk before you deployed it to the device. Just building the apk is not enough. There is an "archive" menu option in the context menu of your Android app. More info on that can be found here https://learn.microsoft.com/en-us/xamarin/android/deploy-test/release-prep/?tabs=vswin#archive-for-publishing
Build it in release mode. Debug builds aren't signed. Then make an archive and distribute it (ad-hoc-mode). This will create a signed apk. More info: learn.microsoft.com/en-us/xamarin/android/deploy-test/… – Andre Kraemer
I am trying to prepare my app for release.
When I run the app from android studio it works fine. But when I upload a beta build to the Play Store or I run adb install android/app/app-release.apk and try to run the app on my phone, it shows the Unfortunately App, has stopped message.
How can I debug this? Is there a way to run the release build on my phone through android studio so that I can view the logs?
I have never tried, but leave your device plugged in to USB. Run adb logcat in the terminal.
There's probably additional settings to filter for your specific application package
I installed the app through android studio and its working fine, but when I create the apk and then I installed the apk, on some devices my app is crashing.
Can someone know how we can see the logs or errors in case when we installed through apk, in can't debug the app bcos its working that time.
here are few details,
build variant: debug,
my apk name: app-debug.apk,
and I am using 2 3rd party libs as an .aar files
If you have installed the apk also you can able to get the logs if you have connected your device with studio. For that you have set the No Filter in Android Monitor.
In the phones, your app is crashing, don't just install the app by apk there. May be some of your 3rd party dependency is not compatible with those versions or phones.
Debug your app in those phone with cable and check error logs. You will get to know the problem
I want to create an Android wearable app on Android studio. I have installed the apk file on mobile to test run it. I would like to know how I can run the same apk on wearable device.Also, apk file created on Studio is different for wearable and mobile devices. How can we run it? Thanks in advance!
As it mentioned at official website you need to create special package signed by release key. See more info about packaging here.
When developing, you install apps directly to the wearable like with handheld apps. Use either adb install or the Play button on Android Studio.
Note: The automatic installation of wearable apps does not work when you are signing apps with a debug key and only works with release keys.
During the development period, do not use release key for signing. Instead, you should build your app which would result in two apks, one for the phone and one for the wear device. Then install each of them separately on the corresponding device using adb or Android Studio. Make sure you are using the same package names for both apks.
When you are done with your development, then build the app with your release key; then the wear apk will be embedded inside your phone apk and installation of your phone apk on a phone will result in the installation of the embedded wear apk on the wear device (make sure you remove the dev apks from both devices prior to this step otherwise installation will fail due to different keys).
Trying to debug through Android Studio as suggested by Julia and Ali, but it is always showing me Parse error while installing or running the code.
I have created a project for both mobile and wear. While running for mobile it works fine in the mobile device but while running the code in the wear it always shows Parse error.
I am using Moto 360 for running and debugging.