Running applications through sdcard - android

I have put my compiled application in /data/data folder of my android. And I can run it through terminal emulator. How to add that application to "Application list". So, that I can see it as an icon.
Thanks

You have to "run" the app to install it. Use a program like Astro to browse to it and click the app to install it. This will place the icon in your application list.
Update
If you want to install via the terminal emulator, you have to do the following (note: you need to be root on your phone to do this).
Place the .apk on the root of your SD card (for simplicity)
Type "su"
cd into the destination of your .apk (in this case it will be cd /sdcard)
Use "install "name of .apk" /"destination"/"name of .apk"
More information here: http://bit.ly/cpnocZ

Related

Unable to Extract .apk files from Bluestacks app player using adb

I'm trying to extract .apk files of my apps installed from blue stacks player using adb .I am successful in getting the .apk's of files that are present in the location "/system/app". Below is the command that i gave from my command line
adb pull /system/app C:\xyz\ffff
However,When i am trying to get the .apk of the apps that are present in the location "/data/app" it says
"0 files pulled"
However,I'm pretty much sure it has got over 10 apps.
Any help would be highly helpful
1.Download 'apkextractor' app from playstore and install it in your bluetack, This application can extract the applications installed in bluestack
2.To access this .apk files you need any filemanager, And go to extractedApk directory
3.To move apk files from bluestack to pc folder, Move the .apk files from 'extractedApk' to 'windows/pictures' folder
This screenshot will help you
In the latest versions of Android, APKs are no longer simply stored in the /data/app folder.
To get the list of installed packages (and their paths) run the following:
adb shell pm list packages -f
This will show you packages and paths to the APKs. Like this:
package:/data/app/com.android.chrome-2/base.apk=com.android.chrome
Here, you can see the APK resides at /data/app/com.android.chrome-2/base.apk
Running adb pull /data/app/com.android.chrome-2/base.apk works.
You need to do this for each APK shown in the package list. On non-rooted devices, you cannot search for APKs in the /data/app folder because adb does not have permission to view the contents of folders in this location.

Android get .apk file from emulator

I am newbie to the android development. Just out of curiosity i was wondering if it is possible to get back installed .apk file from android emulator ???
The question linked by #thepoosh indeed has some correct answers to your question, but it is not the accepted answer. Scroll down a bit to answer of either #plaisthos or #Pratik.
In short: your .apk resides in the /data/app directory on your emulator. Note: It probably has a name that differs from the name of the .apk file on your build machine, since the .apk get renamed to something that looks like your package name.
So, using adb shell:
- cd /data/app
- ls (and check the name of your .apk file)
- exit adb shell
- on commmandprompt: adb pull /data/app/your.filename.apk
Or from Eclipse use the fileexplorer tab as stated by #Pratik in the other thread.
you can copy the route if you are working in eclipse, the apk that you install in the emulator is the same that is in your project when you compile it, go to folder bin, select .apk ctrl+c and paste in your desktop for example.
How to extract the apk file from device:
First run your emulator.
if you are in windows, open cmd and go to platform-tools : in my case
cd C:\Program Files (x86)\Android\android-sdk\platform-tools
after that run adb as:
adb pull /data/app <the directory where do you wannt to save>
example:
adb pull /data/app C:\Users\tato469\Desktop\app
Access this folder and select your app.
NOTE: Look if only one emulator is running, else it will throw an error.
Are you trying to run the app on a device or do you just want the .apk?
TO run it on a device:
1) Click the project
2) Go to Run -> Run configurations -> Target tab
3) Select Always prompt to pick device then apply.
After which everytime you try and run the application it will let you select any plugged in devices
TO get the .apk
1) Right-click project file
2) Export
3) Follow instructions

In AVD emulator how to see sdcard folder and install an APK to the AVD?

I have created an Android emulator (Android Virtual Device), but I am unable to find out the SD card I have built during creation of this.
How can I find the SD card and its content and also how to install APK files to the AVD?
switch to DDMS perspective
select the emulator in devices list, whose sdcard you want to explore.
open File Explorer tab on right hand side.
expand tree structure. mnt/sdcard/
refer to image below
To install apk manually:
copy your apk to to sdk/platform-tools folder and run following command in the same folder
adb install apklocation.apk
I have used the following procedure.
Procedure to install the apk files in Android Emulator(AVD):
Check your installed directory(ex: C:\Program Files (x86)\Android\android-sdk\platform-tools), whether it has the adb.exe or not). If not present in this folder, then download the attachment here, extract the zip files. You will get adb files, copy and paste those three files inside tools folder
Run AVD manager from C:\Program Files (x86)\Android\android-sdk and start the Android Emulator.
Copy and paste the apk file inside the C:\Program Files (x86)\Android\android-sdk\platform-tools
Go to Start -> Run -> cmd
Type cd “C:\Program Files (x86)\Android\android-sdk\platform-tools”
Type adb install example.apk
After getting success command
Go to Application icon in Android emulator, we can see the your
application
These days the location of the emulated SD card is at /storage/emulated/0
On linux sdcard image is located in:
~/.android/avd/<avd name>.avd/sdcard.img
You can mount it for example with (assuming /mnt/sdcard is existing directory):
sudo mount sdcard.img -o loop /mnt/sdcard
To install apk file use adb:
adb install your_app.apk
DDMS is deprecated in android 3.0. "Device file explorer"can be used to browse files.
Drag & Drop
To install apk in avd, just manually drag and drop the apk file in the opened emulated device
The same if you want to copy a file to the sd card
if you are using Eclipse. You should switch to DDMS perspective from top-right corner there after selecting your device you can see folder tree. to install apk manually you can use adb command
adb install apklocation.apk
I have used the following procedure.
Android Studio 3.4.1
View>Tool Windows>Device File Explorer
//in linux
// in your home folder .android hidden folder is there go to that there you can find the avd folder open that and check your avd name that you created open that and you can see the sdcard.img that is your sdcard file.
//To install apk in linux
$adb install ./yourfolder/myapkfile.apk
Adding to the usefile DDMS/File Explorer solution, for those that don't know, if you want to read a file you need to select the "Pull File from Device" button on the file viewer toolbar. Unfortunately you can't just drag out, or double click to read.

Viewing private files created by an android app

I have an xml file being written by an app that is set to MODE_PRIVATE, but I now want to read that file outside of the phone, for debugging purposes. In Eclipse, I can access other files made by the app and copy them to my computer, but I can't even see this private file. Merely changing the file to MODE_WORLD_READABLE file doesn't seem to help. I think the file is being stored on an internal "SD card" that can not be removed from the phone, but there are also two other folders in the File Explorer that are either empty or inaccessible: asec and secure.
Does anyone know how the file can be accessed?
If your app is installed in debug mode, you can get your private files on a device without rooting.
Go to [android-sdk]/platform-tools folder and run adb shell.
run-as com.example.yourapp
cp -r /data/data/com.example.yourapp /sdcard/
(Where com.example.yourapp is the package name of your application.)
After executing the steps above, the private folder of your application is copied into the root of your sdcard storage, under your package name, where you have permission to download and view them.
Note 1: If you don't need to download them, then instead of step 3, you can use unix commands to navigate around and list files and folders.
Note 2: Starting from Android Studio 2.0, you'll find more files in the cache and files/instant-run folder, related to the Instant Run and the GPU Debugger features, placed there by the IDE.
You will need to connect the phone and do some magic to let your sdk work with it (I think put it in debugging mode?). Go to where you unzipped the android sdk:
C:\android-sdk_r10-windows\android-sdk-windows\platform-tools>adb shell
#cd data/data/com.yourpackage.yourapp/files
#ls
You should see your file listed. You may need to run "ls data/data" if you're not sure what the fully-qualified name of your app is. From here if the file is small and you just want to see what's inside it you can run:
#cat yourfilename.xml
Alternatively:
#exit
C:\android-sdk_r10-windows\android-sdk-windows\platform-tools>adb pull /data/data/com.yourpackage.yourapp/files/yourfile.xml
Note: I have only tried this on the emulator, I don't know how to use adb with a physical phone.
You need to root your phone to see Context.MODE_PRIVATE files
It ends up being stored in data//files I believe but you need root permission to see them
So either root your phone or wait until you finished debugging and then add Context.MODE_PRIVATE
If Eclipse is used, there is one more option:
DDMS Perspective > File Explorer tab > data/data/com.yourpackage.yourapp/files
where you can pull/push/delete files.
Another option is to have a command in the app that dumps the private files. This only works if you don't want to edit the files, but has the added bonus that you don't have to strip it out before it goes to production, because the user can't break anything with it. Well, as long as the files don't contain sensitive information. But, really, if they do, you're doing something wrong. As #user1778055 said, a user can root their phone to access it.

Upload Android Source Code into real device

I have build whole android source code...with the help of make command....for dream htc product...now i want to deploy those files(system.img,recovery.img,userdata.img,boot.img) in my real device htc t mobile g1...how can i deploy those files....?
I assume you're just starting out with Android, in which case it would be very wise to use the Android Development Tools Plugin for Eclipse, which I'm guessing you're not doing currently.
Once you install that, deploying to your application to your Android device is as simple as right clicking the project in Eclipse, and selecting "Run As -> Android Application".
Note: make sure you enable debugging on your phone: "Settings -> Applications -> Development -> USB debugging".
I guess what u wanna do is create a flashable zip file and install it via recovery,
You need to get the Android Kitchen (provided you have a Linux box or else you have to install cygwin on windows)goto http://forum.xda-developers.com/showthread.php?t=633246
and download the kitchen execute the .menu and you'll find a really long menu that may help you to package the files into a flashable zip file,
and since you are using HTC Dream install the amon ra's custom recovery(you need to root the device first,install the universal AndRoot from play store and root your device)copy the file to your sdcard and rename it as recovery.img if you have a terminal emulator app goto the prompt and type flash_image recovery /sdcard/recovery.img and if you are having trouble with the flash_image binary install busyBox from app store and that should solve the problem,
and after the recovery had been installed goto the terminal app or adb window then type reboot recovery or turn on the device by holding home key and in the recovery window do a complete wipe and select the option flash zip archive or something, browse the zip file you have created using the kitchen from the sdcard and select yes wait for the process to complete. hope this helps you

Categories

Resources