I wrote a small program in eclipse -android.Now i installed and i am running my program which is an .apk
Now i want to know where my .apk file is there and i even want to "pull" it into my system. Is it possible? If so kindly help me.
If you just want the apk to install on a phone or similar use File -> Export -> Android Application
Yes should be possible. Do a adb shell and look under /data/apps (e.g. ls /data/apps). Once you know the filename you can do adb pull filename .
You can run project without make apk, just right click on project >> Run as >> android application.
But if you want to find apk, it is already in workspace/your project/bin/name.apk
Yes it is possible you can also get from the ddms window into the eclipse. In the ddms select the device from the device window at left side and at right side you getting the tabbed window File Explorer, logcat, console etc.
Select File Explorer->data->app
here you getting the list of all the apk files select it and pull it by using right to top button of this File Explorer window.
see this image
ddms view
Use File Explorer within Eclipse to see all the files and folders of your emulator.
Related
How am I able to push .txt files to the emulator using Android Studio?
One easy way is to drag and drop. It will copy files to /sdcard/Download. You can copy whole folders or multiple files. Make sure that "Enable Clipboard Sharing" is enabled. (under ...->Settings)
Update (May 2020):
Android studio have new tool called Device File Explorer. You can access it in two way:
By clicking on Device File Explorer icon in right bottom corner of android studio window.
If you could not find its icon, inside Android Studio press shift button twice. Quick search window will appear, then type Device File in it and Device File Explorer will appear in search result and you can click it.
Then you can navigate to folder which you want to push your file in it. Right click on that folder and select upload(or press Ctrl+Shift+O). Select file you want to upload and it will upload file to desired location.
Push file using adb.exe:
In Android 6.0+, you should use same process but your android application cannot access files which pushed inside SDCARD using DDMS File Explorer. It is the same if you try commands like this:
adb push myfile.txt /mnt/sdcard/myfile.txt
If you face EACCES (Permission denied) exception when you try to read file inside your application, it means you have no access to files inside external storage, since it requires a dangerous permission.
For this situation, you need to request granting access manually using new permission system in Android 6.0 and upper version. For details you can have a look in android tutorial and this link.
Solution for old android studio version:
If you want to do it using graphical interface you can follow this inside android studio menus:
Tools --> Android --> Android Device Monitor
Afterward, Android Device Monitor(DDMS) window will open and you can upload files using File Explorer. You can select an address like /mnt/sdcard and then push your file into sdcard.
You can use the ADB via a terminal to pass the file From Desktop to Emulator.
adb push <file-source-local> <file-destination-remote>
You can also copy file from emulator to Desktop
adb pull <file-source-remote> <file-destination-local>
How ever you can also use the Android Device Monitor to access files. Click on the Android Icon which can be found in the toolbar itself. It'll take few seconds to load. Once it's loaded, you can see a tab named "File Explorer". Now you can pull/push files from there.
Android Device monitor is no longer available in android studio.
If you are using android studio 3.0 and above.
Go to "Device File Explorer" which is on the bottom right of android studio.
If you have more than one device connected, select the device you want from the drop-down list on top.
mnt>sdcard is the location for SD card on the emulator.
Right click on the folder and click Upload. See the image below.
Note: You can upload folder as well not just individual files.
I am using Android Studio 3.3.
Go to View -> Tools Window -> Device File Explorer.
Or you can find it on the Bottom Right corner of the Android Studio.
If the Emulator is running, the Device File Explorer will display the File structure on Emulator Storage.
Here you can right click on a Folder and select "Upload" to place the file
I usually use mnt - sdcard - download folder.
Thanks.
After you drag and drop your files from Desktop to Emulator like this answer here :
https://stackoverflow.com/a/44885506/3904109
Your location of files will be
Android 19, 21, 22 /storage/sdcard/Download
Android 23, 24, 25, 26, 27, 28, 29, 30 /storage/emulated/0/Download
Open command prompt and give the platform-tools path of the sdk.
Eg:- C:\Android\sdk\platform-tools>
Then type 'adb push' command like below,
C:\Android\sdk\platform-tools>adb push C:\MyFiles\fileName.txt /sdcard/fileName.txt
This command push the file to the root folder of the emulator.
refer johnml1135 answer, but not fully work.
after self investigate, using official docs, it works now:
and use Drag and Drop actually worked, but use android self installed app Download, then you can NOT find the copied file, for not exist so called /sdcard/Download folder.
finally using other file manager app, like
ES File Explorer
then can see the really path is
/storage/emulated/0/Download/
which contains the copied files, like
/storage/emulated/0/Download/chenhongyu_lixiangsanxun.mp3
after drag and drop more mp3 files:
adb push [file path on your computer] [file path on your mobile]
on windows 10 , android studio emulator.
be on the directory yourFile.xml is.
on terminal, command:
adb push yourFile.xml \C:\Users\yourUN\.android\avd\Pixel_4_API_29.avd\mnt\sdcard
Pixel_4_API_29 is the emulator name , choose the device you are using on emulator
Just need to drag and drop to the corresponding directory in the ADB
I want to add folder in my Genymotion emulator
I also tried this question and follow all instruction but folder is not showing in file manager
I also download some images from Google but also those not visible in file manager.
In my emulator following file manager installed
File Managerv 1.0.1
The CyanogenMod Project
I solve my problem
First follow this Answer
Go to your VirtualBox VM setting / Shared folder tab
Add a shared folder with the folder you want to shared, and check the
"auto mount" option
Start your VM as usual from the Genymotion software
Your shared folder is available in the /mnt/shared directory
(multiple shared folders are supported)
After that
Change Settings of file Manager in Genymotion emulator change that to root user so all my folder visible also with Shared folders
In Genymotion virtual device, run the application "File Manager" and
READ the advertisement about "low-privileged mode".
Go to "settings" menu from "File Manager"
In "general settings", click on "access mode" and activate "Root
access" mode
Restart File Manager => all directories will be presented
Thanks
Update
In newer version of genymotion you can add files/folder by drag and drop.
It take some time while adding files in emulator. time depends on file size.
Update 2 (Based on #GandhyOnly comment)
To make visible in gallery just drag and drop your images files on emulator they stored in download folder after finish transferring files restart same emulator and images will shown in gallery. Or if you don't want to restart emulator then use following command
adb shell am broadcast -a android.intent.action.MEDIA_MOUNTED -d file:///sdcard/
it will rescan images and show them in gallery. For more detail about command see the actual answer here. I didn't check command I use first method just restart emulator
Simply drag and drop onto the emulator the file that you want to use.
It will be saved in Download folder.
I have a more simpler approach to this .
Open your genymotion , and just
drag and drop
the file in the required directory
I am attaching two screenshots in this regard.I had an app that used pictures, after copying by drag and drop i was able to find pictures in file manager through my app.
**
Just drag and drop like following
**
And you are done
It will be copied to Download Folder
Simply Drag and drop files from your PC to emulator and after copying data, files will be saved in the DOWNLOAD folder. Remember that to make DRAG and DROP service working, do not open Genemotion Software by ADMINISTRATOR privileges.
I'm not sure whether you're using SD card or not. In case you do, try to look in this folder through DDMS file explorer in Eclipse:
mnt/shell/emulated/0/MyFiles
This is where my files go when using standard SD card reference in my code:
File sdCard = Environment.getExternalStorageDirectory();
File directory = new File (sdCard.getAbsolutePath() + "/MyFiles");
How do you install an apk on the emulator in Android Studio from the terminal?
In Eclipse we did
/home/pcname/android-sdks/platform-tools/adb -s emulator-5554 install /home/pcname/Downloads/apkname.apk
Now how about in Android Studio?
Run simulator -> drag and drop yourApp.apk into simulator screen.
Thats all.
No commands.
EDIT: Even though this answer is marked as the correct answer (in 2013), currently, as answered by #user2511630 below, you can drag-n-drop apk files directly into the emulator to install them.
Original Answer:
You can install .apk files to emulator regardless of what you are using (Eclipse or Android Studio)
here's what I always do: (For full beginners)
1- Run the emulator, and wait until it's completely started.
2- Go to your sdk installation folder then go to platform-tools (you should see an executable called adb.exe)
3- create a new file and call it run.bat, edit the file with notepad and write CMD in it and save it.
4- copy your desired apk to the same folder
5- now open run.bat and write adb install "your_apk_file.apk"
6- wait until the installation is complete
7- voila your apk is installed to your emulator.
Note: to re-install the application if it already existe use adb install -r "your_apk_file.apk"
sorry for the detailed instruction as I said for full beginners
Hope this help.
Regards,
Tarek
For those using Mac and you get a command not found error, what you need to do is
type
./adb install "yourapk.apk"
Start your Emulator from Android Studio Tools->Android-> AVD Manager then select an emulator image and start it.
After emulator is started just drag and drop the APK Very simple.
Just drag APK file to android emulator it will install automatically.
In android studio emulator to run an apk file just drag the apk into the emulator.The emulator will install the apk
Much easier is just to start your emulator, then go to sdk/platform-tools and use adb from there to install apk. Like:
adb install xxx.apk
It will install it on running emulator.
Drag and drop apk if the emulator is launched from Android Studio. If the emulator is started from command line, drag and drop doesn't work, but #Tarek K. Ajaj instructions (above) work.
Note: Installed app won't automatically appear on the home screen, it is in the apps container - the dotted grid icon. It can be dragged from there to the home screen.
For Linux: once emulator is running, the following worked for me.
Because I installed the Android SDK on my home directory, I have the following file structure:
home/Android/Sdk/platform-tools/adb
home/AndroidStudioProjects/Metronome.adk
AndroidStudioProjects is a file folder I made for my Android projects. "Metronome.adk" is the file I want to run.
So, using Terminal from the home directory...
./Android/Sdk/platform-tools/adb install ./AndroidStudioProjects/Metronome.adk
Being a Linux novice, I often forget the need to put the "./" in when trying to locate a file or run a command.
After the command achieves "Success", the app is in the Apps area of the emulator and can be run.
When you start Android studio Look for Profile or Debug apk.
After clicking you get the option to browse for the saved apk and you will be able to later run it using emulator
If Android Studio is already open:
Click on File you can find Profile or Debug apk in this menu too
Just download the apk from talkback website
Drag the downloaded apk to the started emulator, Go to settings on emulator > Search for talkback, you will now find it there
1.Install Android studio.
2.Launch AVD Manager
3.Verify environment variable in set properly based on OS(.bash_profile in mac and environment Variable in windows)
4. launch emulator
5. verify via adb devices command.
6.use adb install apkFileName.apk
Upload your apk file on the cloud , then make a direct download link for downloading and then copy that link and paste it on the emulator browser for download it :) ;
In Android Studio: View - Tool Windows - Gradle
In the Gradle tool window navigate to your :app - Tasks - install
and then execute (by double-clicking): any of your install*tasks: e.g. installDebug, installRelease
Note: the apk will also automatically installed when you Run your application
The File Explorer view in Eclipse used to work, so that while an app was running, I could see and manage files in its memory. But since a couple of days the File Explorer is always completely empty. Both for the emulator and for physical devices.
Any suggestions about how to make this feature work again are very welcome!
just to make it an answer :)
Select the device in the Devices, it will show the files in the file explorer for that device.
The easier solution of it is to goto the taskmanager. Kill the adb process. Eclipse will start giving connection error with the AVD. Now, run your android virtual device again from the eclipse. Thats it. Its Done. You'll see the files in the file explorer in a sec.:)
It is the matter of the file 'toolbox' in /system/bin/, and lack a file 'ls' is that directiory. You can try in below steps:
1.Use an emulator and pull the file toolbox down and put it in your SD card of the phone.
2.Use "adb shell" and replace toolbox in your phone.
3.Set the permission to 'rwxr-xr-x' if necessary.
4.Then copy a file which is linked to toolbox and rename it to 'ls'(This step I use Root Explorer).
5.Restart adb you can discover that the ddms file explorer is not empty again~
Hope I can help you :)
refer to: http://www.miui.com/thread-268003-1-1.html
am almost done with my project in android, now I want to make the executable version of the application.
I need to demonstrate it in .exe form as soft app as on emulator, not by built and debug process from eclipse.
what the op is asking for is simple - he wants to create a MS Windows program file that runs just like the APK he's made.
Unfortunately this cannot be done. The only way to 'show off' your program is as people have stated:
Through the emulator on Windows
On an acual device (Once installed, you can disconnect the device from the computer and use it like a normal app)
You can't convert an APK file into a .exe file. APK files hold Android apps as self-installable files already - opening an APK file on a phone or the emulator will start the installation process. It sounds like you just want to sign the app with a 'proper' key rather than using a debug key. To do that, read the official page on signing apps.
You don't need to create a .EXE file for doing what you want. You can just create a bat file that executes adb commands that will: install and start your application in the emulator. I guess, the problem here is that you don't understand how the APK files work... I'm just saying.
OK... in order to install an Android application using adb (which is basically what Eclipse does in the background) you need to do this:
adb install path/name_app.apk
Then, you can start the application by using adb shell am command. You can find info here: http://pdk.android.com/online-pdk/guide/instrumentation_testing.html
Another thing you have to take in account is that you will have to run the AVD before installing and executing your application: http://developer.android.com/guide/developing/tools/avd.html
All those commands you have to execute (may be using a .bat file as I mentioned before) are executables that you can find in the android-sdk\tools directory.
When I have a client that want's to show an app, at conference for example, I always use Bluestacks it's not perfect but it allows you to run android apps on your computer without doing all the technical stuff (like installing an emulator etc).
To install an app on your you computer using the Bluestacks device/emulator you simply click on the apk.
http://bluestacks.com/
Once you create a project/application in Eclipse then along with this you also have created the .apk file. Android can run .apk files, so go to the place where your project have been saved and open it, like this Open Project -->bin-->.apk.
Now send the .apk file to your android phone through Bluetooth or copy it.