I'm new to Android and I was given some .apk files (not created by me) with malware that I'm trying to run on the Android emulator for testing purposes (trying to get app's system call data using strace).I have checked several places online, but I'm stuck trying to install the .apk file. When I run the following command :
./adb install filename.apk
I'm getting this error:
Failure [INSTALL_FAILED_DEXOPT]
Any help is greatly appreciated!
Just Drag and drop apk into your Android emulator. its automatically install by it self.
Related
When I try to run the emulator through Android Studio, I get the message the emulator is not installed, so I try to install it. Every time I get the following error:
An error occurred while preparing SDK package Android Emulator: Connection closed at byte 320157527. Expected 323030753 bytes..
So, per this solution I tried manually installing the emulator and placing it in the [Android SDK folder]\emulator folder. Upon doing this, it would still tell me it was missing the emulator & try to install it in [Android SDK folder]\emulator-2, since the "normal" folder existed.
How do you get Android Studio to recognize manually installed packages?
Fortunately, I have Android Studio working on another PC. The only difference I could find between the two installations, was the manual install of the emulator was missing the package.xml file.
I copied this from my other PC & now everything is working perfectly!
I hope this helps someone else, or really me next time I run into this & can't remember how to fix it.
I am trying to install apk from android studio. Initially I got below error:
So I disable instant run as suggested in many post on stackoverflow like this How To Stop Installation of Multiple Slice APK In Android Studio 2.3.
Now I am getting below error after disabling instant run:
java.io.IOException: An established connection was aborted by the
software in your host machine Error while Installing APK
I have only one instance of android studio running when I got this error.
Android studio version is 3.3.1. What can be cause of above error.
Also I am not able to install apk using adb install command. I am getting message failed to install apk with no detail message.
You can restart Android Studio : File -> Invalidate caches/restart
And i think you install ADB-Idea pluggin to uninstall or clear app data very easy with shortcut.
ADB-Idea pluggin :
Link
So I found out why I was not able to install apk from studio or from adb install command. Issue was due to my pc usb port was blocked by network administrator of our organization as my usb port usage period expired. So if anyone facing issue of not able to install apk and getting error as mentioned in question and no solution working for you than please check if your pc ports are not blocked by your organization network admin. I took approval to use usb port and it is working now.
You have got the first error because of :
You are testing your project_A on a emulator_E
As you had the app project_A, installed on the emulator_E, in previous run.
Now you started the execution of your project_A, again on the emulator_E.
The Android_Studio and emulator_E, both came to know that, the apk is already on the emulator_E, so just, whatever the new changes are, will be synchronised, within the, already available project_A apk, on the emulator_E.
But as the whole process takes some time, you uninstalled the apk of project_A on a emulator_E.
And now project_A on a emulator_E is not there, but Android_Studio tried to synchronised it, which leads you to the ERROR_1
Solution
You are following many approaches, for the same thing.
You are starting your project, project_A on the emulator_E by :-
via ADB INSTALL from the command line too
With Instant Run too
With Instant Run too
And you are not keeping the previous apk as it is there on the emulator_E, after starting the execution too.
Uninstall it from emulator_E, but before you start the execution for emulator_E. Which lead to your Android Studio to some dangerous STATE_A and, Android Studio is not tested by google for such types users
It may seem harsh, and obviously it is not the answer, but this is the exact problem, which is leading you to the such case.
I'm building my apk using Buildozer in Ubuntu. But I am more comfortable using BlueStacks in Windows for the testing purpose. My app crashes after it starts with no apparent signals. How can I debug it using BlueStacks?
There's a debug tool with file name: HD-Adb.exe in Program Files (Program Files (x86) in Win64) path of BlueStacks. When you run this tool, you could see all what happens behind the android emulator. It's easy to debug your app then. To run the tool open command line in Windows and type the following lines:
> cd "c:\Program Files (x86)\BlueStacks"
c:\Program Files (x86)\BlueStacks>HD-Adb.exe logcat
I really had hard time trying android sdk emulator and other things. But this works great! Enjoy debugging.
I'm attempting to use Android's updater script language (Edify?) to install an APK over-the-air to an embedded device that I have control over. Here's a link that describes the language.
My first attempt was the following:
package_extract_file("added_files/data/app/test.apk", "/data/app/test.apk");
That resulted in test.apk being automatically installed in /data/data/com.acme.test, however the directory /data/data/com.acme.test/lib is empty, whereas it should contain test.so, a shared library contained in test.apk. (If I manually install using adb install test.apk, the library is extracted.)
I then tried extracting the APK into /data instead of /data/app so the OS wouldn't automatically install it into /data/data, and I could try installing using the script:
package_extract_file("added_files/data/app/test.apk", "/data/test.apk");
run_program("/system/bin/pm", "install", "/data/test.apk");
That resulted in the following error:
about to run program [/system/bin/pm] with 3 args
run_program: execv failed: Exec format error
run_program: child exited with status 1
I'm not sure why the above error happened.
Is there a way to install an APK and have its shared libraries extracted automatically? I could install the libraries manually, but I'm hoping to avoid that.
I'm not familiar with Edify, but by looking at the documentation, package_extract_file() simply extracts the APK as the archive file that it is. Why data ends up inside /data/data is strange; are you sure that isn't just left behind from a previous installation? I'd suggest fully uninstalling the app and trying again.
It seems to me that that particular function isn't suited for installing the app. You might want to try installing it through a command:
run_program("adb", "install", "-r", "added_files/data/app/test.apk");
Edify scripts run in a recovery mode and depending on your device not all partitions are available by default. Most likely your problem is that the partition you are trying to use is not mounted yet.
Is there a way I can just update the apk file after making changes to the android source file in eclipse. I want to be able to do this without actually pressing the Run button in eclipse.
The reason I want this is because - I usually keep the emulator open in the background (since booting it up everytime takes too much time on my slow computer). And when I run the program after a previous run, eclipse just seems to hang up - even after I have stopped the app in the emulator.
So I decided to use the adb install command-line program to install on the emulator, but am unable to get the apk file updated without actually pressing on the run button in eclipse.
Actually, the Eclipse ADT plugin works like you want it to work. Everybody just run emulator once and then pressing RUN button update the application. If you have problems with this post the logcat during the run of your application.
You always can check the Build Automatically option in the Project menu option in Eclipse. Or you can Project->Clean your code, sometimes Eclipse get stuck trying to refresh all projects and dependencies.
You can un-install apk package with command line----
in linux os example:- adb shell pm uninstall -k <package name>
You can leave -k if you don't want to delete data and cache. If this command is failed then use emulator;
open settings in emulator -> apps -> your app and then stop it or un-install with emulator and it is more easy. Options are depend on emulator device.