IntelliJ IDEA Android emulator installs multiple copies of the app - android

Each time I launch my Android app in IntelliJ IDEA's virtual emulator, it seems to install a new copy of the app. I have 4 copies of the same app in the emulated phone now. :/ Is there a way I can force the emulator to install over the previous installation each time I run it, instead of installing a new copy of the app?
Edit: I've found that selecting 'wipe user data' works in a pinch. I'm hoping there is a more elegant solution though, as wiping clears out everything (including files on the phone, user logins etc) which isn't always what I want.

Related

No emulators are currently running

No emulators are currently running
Wrote a program in Kotlin. Everything was fine, everything worked. I turned on my laptop a week later. Launched Android Studio/AS/. The code opens fine. Only emulators do not display the phone. Writes that there are no working emulators. No reboots of either the system or the AS, updates with a full restart of the program help. I want to delete the device, Device Manager/DM/ also does not allow it, because DM says that it is now working. I can’t find any AVD services. In the Task Manager, I can’t find anything either.
Dear gurus advise what to do.
The next step is to reinstall AS. I just can’t reinstall AS every time the emulator freezes.
Thanks in advance.
By the way, as I have no choice I reinstall the AS that helps.

Xamarin android emulator error: App not installed

I am trying to install app on a Nexus 4 virtual android 5.1 on Xamarin Virtual machine. If i want to install an app, I mostly get this error: App not installed (don't get this during some installations but 95% get this error).
I did ofcourse lots of research and testing.
Install Android studio their VM. Same error.
found some potential solution here
*Reboot the phone: In times like this, first thing to do is to reboot your device. Or just shut down, remove and reinsert your battery. Done and no luck
*Make sure to uninstall any apps you don’t use to free up space, also uninstall previous versions of the same app currently installed on your device.
I download them all for the first time via APKpure.com
*Double check the apk files you download and be sure they were completely copied or downloaded. App are released by companies their self and are fully downloaded
*Try resetting app permissions by going to Settings >Apps>All>Menu key >Reset application permissions or Reset app preferences. Done and no luck
*Change app installation location to Automatic or Let system decide. don't know how this is possible without a root
*Make sure your SD card is not mounted or connected to a PC or elsewhere. no Sd card
*For worst case scenarios, format your SD card – copy it’s contents somewhere else for backup and format. no Sd card
*The last solution would be to totally wipe your device. Either by doing a factory reset under Settings or by doing a full wipe in recovery mode. I even reinstalled Xamarin
Downloaded an android 4 version, no luck.
I found lots of post where they were talking about signing. I did not change the APK files and I never managed to install them before.
downloaded never Nexus device with A5.1 and still same error.
Help is much appriciated.
I've always had problems with Xamarin Android Emulator.
Please use the Android Emulator (AVD) instead which contains less bugs than the Xamarin one.
Click here for a guide on using the Android AVD.
And in the meanwhile, you can report the bug here to Xamarin with any relevant information such as logs and errors seen during app deployment.
The problem seemed to be an compatibility issue with lots of apps. I was able to retrieve the Logcat and after looking at the logcat, that was our only conclusion.

Testing Android app on real device with IntelliJ IDEA

I'm a bit confused as to how testing on a real Android device works. I hooked up my device (Samsung Galaxy S4) and set the app to run on it, and it works fine. Then I make some changes, and click 'Run' again... but that just brings up the old copy of the app (prior to my changes). Currently the only way I know how to get the updated version of the app on my device for testing, is to manually uninstall the app via Settings before clicking 'Run' again.
Is there a way to shortcut this process and have my updated copy of the app replace the old copy each time I run it?

Android Eclipse: Ruined my emulator plus can't detect new Alcatel phone

In the last 36 hours, I've managed to screw my eclipse settings .. from being able to run my app, to now not even launch the emulator properly.
I think it started when I modified the AVD's SD card size and added a camera. Since then I've deleted the AVDs and recreated them. But eclipse now takes 20-30 mins to launch the emulator, and fails while trying to install my apk. When the emulator finally runs, I can't find my app so its not as if its installing and only failing to launch.
Also I bought a new Alcatel Onetouch 918n phone. After some painful steps, I now see "Alcatel Android ADB interface" in Device manager. But I just can't seem to make this phone visible to Eclipse/ddms/adb.
I don't have many logs to paste here- not sure what I should include. HELP!!!!
Have you tried just creating a new virtual machine? A lot of times changing sd card values ect can make it take much longer to load as well, you can also export to the .apk and load it onto your phone manually to test (tedious).

Emulator questions

Do I need to restart the emulator everytime I make an edit to the app I'm working on? Also I have created a databse in one of my apps and open this app in the same emulator each time. Each time I open the app does it create a new database on the emulator or when I close it and re open it is the database still there with all the stored values?
You will not need to restart the emulator each time, you can just push the new version of the APK to the device manually, or Eclipse will handle this automatically.
It will reuse the already created database unless you uninstall the application from the emulator or clear the application's data.
As Eclipse installs the application for you when you hit the "Play" Button, I usually use the command "adb uninstall my.app.name" to remove the application as it is faster than browse to the data folder and erase the database.
You don't need to restart the emulator every time you modify your code, just keep it open. In fact, even if you are using Eclipse, you don't need to start the emulator from inside the IDE, you can run it separately and Eclipse will find the running emulator. This is very useful when you need to run a custom kernel or a custom memory partition.
The emulator is, for all intensive purposes, like your phone.
So stopping and starting the emulator is like turning a phone off/on. The data in a database should remain persistent.
Also, don't keep re-starting the emulator. Way too slow.. By "Running" the application each time you make a change, will tell Eclipse to send a new APK file to the emulator. You can see the build and deployment in the Console occurring when you run the application. The emulator session continues to run, but a new APK file is deployed and launched.
If you encounter strange startup problems, try "Cleaning" the project as well.
It is not mandatory to restart emulator every time. It will use already existing database unless you install the app

Categories

Resources