I'm working in eclipse and trying to use my phone (HTC Thunderbolt) for development for the first time (because the emulator is too slow).
In Eclipse I get the error:
Android ActivityManager: am: not found
(The error is after Android Launch!, adb is running normally, and Success!, etc.)
Using adb shell, I see that the am file is not located in /system/bin or anywhere else that I looked. I'm running a custom ROM on my phone. Is it possible the file is simply not present? If so, can I push it to my phone? How?
Thank you
EDIT: Using adb shell, from /, I ran ls -R | grep "^am$" and there is no file named "am".
I have seen posts like this one where they mention an error message like system-bin-sh-am-not-found, but in those cases the file is actually present and needs to be edited. In my case, the file is not present. Anyone have a copy of /system/bin/am for Gingerbread? Is it the same for all devices?
Look into your bin folder, there should be a file named after your project followed by .apk
example. project name = mountainx, the file is mountainx.apk
copy that into your handphone storage, then install it from your phone via application installer or any other applications that can access the apk file
The problem was related to the custom ROM I was running. The ROM cook had not included that file in the ROM.
Related
I am developing an application using ionic framework.
The app creates files (*.json) and stores them in /data/user/0/ when i verify whether they exist or not, the result was true which means the files exist in the mentioned directory and I can access and modify their content without problem, but when I check the directory with a file manager or from the computer, no result, the directory is empty.
Could someone tell me what should I do?
use adb to copy the file. Even if it's in root dir, u should have access to it via adb.
Do adb pull data/user/0/filename.json path_on_ur_comp.json.
this will copy the file to the directory you define in the 2nd parameter.
// EDIT:
adb is part of the Android SDK, stands for Android Debug Bridge.
You can use this for MANY MANY different reason but of course, the "main" reason is to debug Android devices. You can use it to transfer files in your case.
In Windows, it's located here:
C:\Users\USERNAME\AppData\Local\Android\sdk\platform-tools\adb
In Mac, it's lcoated here:
/Users/USERNAME/Library/Android/sdk/platform-tools/adb
Depending on which OS you use, open that either with Terminal (Mac) or Command Prompt (Windows).
Once you do that, run the following command:
For Mac:
adb pull data/user/0/filename.json /Users/USERNAME/Desktop/somefile.json
For Windows:
adb pull data/user/0/filename.json c:\Users\USERNAME\Desktop\somefile.json
This will copy the file and put it on your desktop
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.
I'm developping the obb integration for the "expansion files". I made it worked in local by copying the .obb file on the sdcard of the device (4.1) but on my 4.2 devices it is not working anymore.
1) On 4.1 tablet: it's working well. I pushed my extension pack file using an adb command on a tablet and then I'm able to find the file and read it :
adb push main.1.mypackage.obb /sdcard/Android/obb/mypackage/
shell#android:/sdcard/Android/obb/mypackage/ $ ls -al
-rw-rw-r-- root sdcard_rw 20314171 2013-08-05 18:01 main.1.mypackage.obb
2) On 4.2 : the same procedure as above, the file is not "visible", both exists() and canRead() methods on the main activity return false.
adb push main.1.mypackage.obb /sdcard/Android/obb/mypackage/
shell#android:/sdcard/Android/obb/mypackage/ $ ls -al
-rw-rw-r-- root sdcard_rw 20314171 2013-08-05 18:54 main.1.mypackage.obb
Solution : From there, I investigated using the app "Android File Transfer" and I found that the obb folder is empty from the tool… so it is not the same folders I push the data into…
I uploaded the .obb using the app "Android File Transfer" and then it is working… But in that case I don't know where the file are stored (not on the sdcard, I guess ??)
So guys, what I need to change on 4.2 for accessing my .obb file? Thanks in advance
Extra informations:
a) I made a basic test to check the file existance using "file.exists() + " canRead=" + file.canRead()" with Environment.getExternalStorageDirectory :
File file = new File(Environment.getExternalStorageDirectory().getAbsolutePath()
+ "/Android/obb/packagename/main.1.packagename.obb");
b) The procedure is scripted so the issue is not coming from a manual mistake (and triple check everythings)
EDIT
c) To sum up :
With "adb push" on 4.2 it is working for "normal" data: If I put a folder with images in /sdcard/myfolder/ it is working but not below /sdcard/android/.
The Android File Transfer shows a "Android/obb" folder at the root and .obb files are visible from the code in that case but:
I cannot confirm it is on the /sdcard from the 'Android File Transfer App', what is disturbing me is that doing an "adb shell ls /sdcard/Android/obb" display that the folder is empty…
I cannot use the same script for 4.1 and 4.2, validate the production procedure and use it in dev to save a lot of time with a light apk (and save time on build & deployment time)…
SOLUTION USED INTERNALLY
For < 4.1
adb push main.1.mypackage.obb /sdcard/Android/obb/mypackage/
For >= 4.2
adb push main.1.mypackage.obb /mnt/shell/emulated/obb/mypackage/
Use monitor (Android Debug Monitor) to put expansion files on your device for testing.
My experience with a Nexus 7 (not rooted) using: command line adb vs monitor (Android Debug Monitor)gui:
1) adb push main.1.com.mypackage.obb /sdcard/Android/obb/com.mypackage/main.1.com.mypackage.obb
looked successful. However the app could not find the expansion file, and a file explorer on the device could not display the file. note:the device was not rooted and I could not run adb root.
2) using the monitor gui - start from command line with: ../sdk/tools/monitor
Using the monitor gui showed that the /sdcard location actually pointed to several different file links. In order for the app to see the expansion file I had to put the expansion file to the proper linked file location - in my case this was /mnt/shell/emulated/obb/com.mypackage - which adb shell still did not show, however the apps on the device could reach the file.
As I understood, everything works fine when you push file into Android's file system manually. In that case, I believe that problem is with some bug in adb or some misprint.
Anyway, you will have to provide Google services integration in order to download APK files from Google servers and you will not have to deal with adb or any other utilities, so I think you don't have to focus on that problem.
not on the sdcard, I guess ??
If it's in /sdcard/ folder - it's on sdcard.
Android put some kind of safe guard in 4.2 for the obb folder(for cracked games and stuff). Take a look for more info in google's android api
I push my backed up obb files form many games and prefer to push them back via adb and I always have to use the full folder structure line so try using
/mnt/sdcard/Android/obb/AppDataFolderNameHere
so for you the code would be;
adb push main.1.mypackage.obb /mnt/sdcard/Android/obb/mypackage/
shell#android://mnt/sdcard/Android/obb//mypackage/ $ ls -al
-rw-rw-r-- root sdcard_rw 20314171 2013-08-05 18:01 main.1.mypackage.obb
many Linux devices just have the sdcard in the mnt folder event though its a separate storage device.
I am quite new in Android and I intended to run some sample programming downloaded from the web, but I faced problem in extracting the .apk file, in the .apk file there are META-INF, res, manifest, .dex and .arsc, how I am going to open the sample program in the Eclipse? I just wanna run some sample coding... Thanks.
You don't need to open the program in eclipse to run it.
Just type
adb install -r filename.apk
The -r flag is to allow re-install if it already exists with the same signature. If it exists with an incompatible signature you will have to remove it.
If adb complains you have multiple devices, do
adb devices
Notice the serial number of the one you want, and then
adb -s SERIAL -r filename.apk
Actually opening an existing apk in eclipse would be relatively pointless without a depackager/decompiler, which is another topic altogether.
I am making one app on Android and I have no idea what is doing one file which is installed after app installation. This file is quite big (this is about this same size as installed apk - even after uninstall ~ 5MB) so this is the reason of my question.
he file is set in data/local/tmp/'name of my apk'.apk
What is it and when it is deleted, because when I'm testing my app on emulator and uninstall it then it still exists.
EDIT AND ANSWERS:
I am not sure of my app is using tmp files. The only file or resource my app is using is movie placed in resources folder which is around 5MB. Deleting this file after app uninstall brings back free space. Before uninstall no. But I want to have deleted it melodramatically or not created at all because this file makes me app 2 times bigger.
The files in there are temporary files and you can safely delete them.
For instance, these are created when you:
Install an APK trought the command line with adb install (the temporary file will have the same name as the original file);
Install / Run an application through Android Studio (the temporary file will have the application package name).
To easily list all the temporary files, you can use the following command:
adb shell ls /data/local/tmp
To remove all of them, you can just use the following command:
adb shell rm /data/local/tmp/*
The .apk is your application. You'd be Sad if Android deleted it behind your back :)
http://developer.android.com/guide/developing/building/index.html#detailed-build
http://www.ibm.com/developerworks/xml/library/x-androidstorage/index.html
This file is the uploaded apk on emulator. Like normal file upload on device.