Android abd command - android

I've an application,it has a data base.I've rooted my device.When i click data folder,it is empty.
I've three things to know,
1. What is the adb command to pull the data base file.
2. When i type this command adb devices,it showed emulator and my device number.What is that number,it is not IMEI number.
3. what is the services in the windows for adb?
Thanks in advance!

I've rooted my device.When i click data folder,it is empty.
Don't use DDMS for this, use:
adb shell
su
cd /data
ls
You should see plenty in that folder.
Alex's suggestion in his comment has always worked for me as well: adb pull /data/data/[package name]/databases/[database name]
You're seeing the device ID. As you noticed, it is not the IMEI. Not all Android devices have IMEIs anyway. It's a separate identifier.
You'll have to clarify on this one, I have no idea what you're saying.

Related

How I can pull files from my Android Sony Xperia Z1 using ADB tool? P.S My phone is rooted

I tried on my own but failed , when I looked around I didn’t find except tool called adbd insecure which make me can run this command
“adb root”.
when I run this command I got no response on CMD and when I tried to use this program mentioned above on my phone I got an error.
when the desired action when I run the command "adb root" om my Windows 10 OS
is "adbd is already running as root" in CMD.
So far I can run "adb pull /data/data & put it everywhere on my PC".
Any help please.
Okay, so here are the steps that works for me.
I'm a Linux user so you can later convert terminal commands to windows if necessary:
Since you mentioned that your device is already rooted:
adb devices--> Make sure your device is connected.
adb shell--> runs shell command on your device.
su --> gives you root access.
cd data/data --> (data/data/xyz) is apparently the file you want to pull).
pwd--> will display the path.
copy that path and save it somewhere.
use "exit" to get out from the shell.
Once you are back in C:\Program Files (x86)\Android\android-sdk\platform-tools, run adb pull (paste the path that you copied).
Now you should have your file. Hope that helps.

Android adb & adbd

I have next situation:
I got 2 version of adb and 2 versions of adbd on 2 different devices.
How can i use both versions of adb from my workstation for these 2 devices.
I mean:
1 adb for 1 device.
2 adb for 2 device.
Now i have following situation:
Every time when i run another adb, previous adb server kills and new one starts.
How can I workaround it?
I think you are asking the wrong question. What I think you want is to run two adb commands at once on different phones. Is that correct?
If so what you are looking for is
adb -s DEVICE_SERIAL xxx
where DEVICE_SERIAL is the value shown when you run adb devices and xxx is the command you want to run. Use adb devices for a list of connected devices.
This only requires you to have one version of adb installed, just open up a new terminal and run the command for the different serial numbered device!
If I'm understand the question correctly I believe he's trying to run two different versions of ADB at the same time. If my assumption is correct then here is what you'd want to do.
Lets assume you have adb.1.0.29.exe and adb.1.0.39.exe on the root of the c: drive which were renamed from the adb.exe from the different versions of platform-tools SDK versions they were supplied in.
To run the ADB version contained within adb.1.0.29.exe all you have to do is what the linked articles say BUT be sure to call the proper exe for that version. I used these adb version names as examples. You can name the adb.exe whatever you want.
So you can call adb commands with different versions as follows,
c:\adb.1.0.29.exe -s serial_of_device adb_command
or
c:\adb.1.0.23.exe -s serial_of_device adb_command
Cheers,
-Rob

How to move apps to sdcard via shell script

I want to write a small tool to move apps to SDcard.
I found the movePackage()-method in Android Open Source and reflect the method. I failed because this method need com.android.PERMISSION.MOVE_PACKAGE which I cannot get. So I want to using shell script to do this for rooted devices.
But I don't actually know what happened in the movePackage()-method. So I can't write the correct script.
Could you please tell what happened inside the Android when a app is moved to SDcard? Can I do this with program?
I'm not sure If I understand you, but on rooted device you can use adb.
For example:
adb push /home/username/Desktop/app.apk /sdcard/app.apk
Also you can do this (for removing):
adb shell rm /sdcard/app.apk
If you want to install:
adb install /home/username/Desktop/app.apk

Eclipse has multiple copies of same Android Device

I've been programming for Android devices for some time now and just recently came across this:
There is a single one in the list online, but I can't run/debug my programs because it reports "ADB rejected install command with: device offline" since every other device has the same ID.
A reset fixes this, but is there any other options? Why is this happening?
Exit eclipse, kill adb and restart eclipse
I find that the issue is often with a bad cable or connection. Try and insert it into another USB slot or try with a different cable, worked for me.
I had to remind myself how to call the commands, so I thought I'd write an answer for other people that don't remember how.
Find the location of adb.exe.
Open up command prompt.
In command line, change the directory to the directory from step 1.
For me, the command and directory is: cd C:\ADT\sdk\platform-tools
Run: adb kill-server from the command prompt
Run: adb start-server from the command prompt
Credits to Squeazer for the commands.

Android eclipse emulator: can't access data/app

I wanted to delete my custom apps on the Android emulator in Eclipse. I followed this guide and encountered the same behaviour as described in this question. I also tested the root access the same way Arsalan mentioned in his first answer and got the same result.
I would like to try if Vyomas approach works, but I don't know the command for deleting an app.
Can anyone help?
I am assuming you are getting "rm failed for minesweeper.apk, Read-only file system"
If that's the case, then you could always press "page up" to bring up the menu in the homescreen and uninstalled it through Settings -> applications -> Manage Applications
Or you could keep going comando style and use this from androidkit, worked for me:
Using adb shell :
Important: The device has to be unplugged from USB if you are trying to uninstall from the emulator, else emulator should not be open and device needs to be plugged in the USB of the PC if you are trying to uninstall from the G1 Device. If either of them are not connected the adb shell command will not work.
Go to the shell and making sure adb is in PATH:
Go to shell (from cmd->adb shell or directly through a terminal)
#
#cd data
#cd app
#cd ls
#rm com.company.product.apk
Can you not just reset the device on startup if you want it removed? If your using the Eclipse add-on to use the emulator just select the box to wipe user data before you launch?
Si

Categories

Resources