Testing Android app on real device with IntelliJ IDEA - android

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?

Related

Connect to an Empty Activity app to a physical device

Recently, I tried to build an empty activity app using Android Studio for some poc purposes. I connected the app to a physical device through USB. When running the app, it is working on the device just fine except that it does not save the app to the device.
Whereas when I created the app using basic activity and run in the device, it saves the app on my device's screen and installed it into the memory.
Does anybody know the reason and solution for this?
FYR, I am using Huawei VOG-L29 as the device for testing.
You missed the app in the device somehow. The template you use to create the initial project doesn't matter- its not part of the final build. Android Studio doesn't even remember it once it's done generating the initial files. When you upload an app to the device, it will be saved to internal storage and should appear in settings.

How to persist the state of hot deploy before unplugging USB on Android Studio?

I tested some easy application on Flutter in Android Studio and did the following:
I took HelloWorld program as a basis for changes.
I made a change on app in Android Studio and on press of enter the change was on screen of my device.
I unplugged the connection USB from my computer and closed the app on phone.
I opened again to the app and it was in state on which it was before step 2.
Is this the supposed behavior in Flutter, that changes that are made during the hot deploy, are not persisted to phone? What is the way to get them persisted after the blocks are in correct place, or is the only way to somehow build the app as realease and deploy in some other way after that?
My idea is to play around with Flutter on Android and my wish is to showcase the accomplishments when ever I have unplugged the device.
If you want to keep the app on your phone, instead do a flutter build or flutter build --release
And then install that binary on your phone.
Unplugging the phone during debug session and keep using the installed app is not intended.

IntelliJ IDEA Android emulator installs multiple copies of the app

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.

Android studio, nothing comes in emulator on running app

I am trying to run the simple "Hello World" program in Android Studio for last two days but whenever i run the app, emulator opens but app doesn't even after waiting.
I tried a lot of things from internet but nothing worked. Please help me out or suggest some other alternative to run and test the app.
Sometimes the app does not launch automatically in the emulator.
In the emulator, open the app drawer (the screen where you can see all apps in the emulator) and see if your app is in the list of installed apps.
Otherwise, you're having another issue.
Note: I suggest that you use the Genymotion emulator. It is far better than the default Android emulator.

How can i start my app written with libgdx on my android device?

I have written some codelines with libgdx in eclipse and want to run them on my android device.(It's a tablet)
But i cant find out how to do this.
I even cant run it on the android emulator provided by the android sdk. I get an error that the app stopped unexpectedly.
The app is working fine with the desktop launcher...
I hope someone can explain me how to get it working on the emulator or on my android device.
I saw somewhere that simply connecting my device via usb should be enough that eclipse is able to create an temporary app on the device, but this also didnt work.
Regards
1st of all, download SamsungKies[latest], to get and install proper USB Drivers. Its important that it should be the latest, cuz there was a bug in the previous versions.
Now that you have the drivers, simply connect your device to your machine IN USB DEBUGGING MODE.
Go to your main activity, and run.
If it launches in an emulator, close the emulator, and again in main activity, select run configurations -> Android Applications -> target -> always prompt to pick device.
Run again, and it should install and run in your phone/tablet.
NOTE:The activity closes in emulator because, by default, the emulator doesn't support OpenGLES emulation, its too heavy for your CPU.
i know its kinda late, but i hope it helps others:)

Categories

Resources