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
Related
I am unable to use "sqlite3" in my Asus Zenfone 5. Its rooted device and has sqlite3 in /system/xbin.
Whenever I run as root, for "sqlite3 file.db", It shows me following error.
Bus error
Its too time consuming to move the .db file to laptop and perform operation and move back there.
Suggest something to work with it.
The issue is fixed now. It was due to two separate versions of adb installed. One through Ubuntu apt-get and one through Android SDK. I purged the apt one. All good now.
Technically: Packages were conflicting.
I am using adb(Android Debug Bridge) and working with shell in the Genymotion Emulator(I have mentioned every configurations at the end of this question).
I execute "adb shell" and get the shell successfully but the problem is that I get the root access on the emulator. I don't want root shell, I want the normal one as we get when we execute 'adb shell' on the actual device connected via USB. How to achieve it ?
Any help would be highly appreciated.
*Configuration :
Ubuntu 13.10, 32-bit.
Eclipse 4.2 with ADT.
Genymotion Emulator(To be specific, I was using Android 4.3 here).
adb shell setprop service.adb.root 0
adb shell setprop ctl.restart adbd
or
adb unroot
for short.
It has been long since I posted this question but still want to answer it as it might help someone in need.
Main purpose of mine was to get a non-root shell on emulator for some testing purposes but failed to do so after many attempts.
Sometimes back, by fluke, I was fiddling around playstore app inside emulator and indirectly came across solution to above question.
I noticed while creating an emulator, if I used "Google Play" as the image, I got an emulator which was not root.
Follow below steps to get an Android emulator without root:
Create a new virtual device and select the one where "playstore" column has playstore icon (small triangle) visible, as seen in screenshot below.
In next step, download appropriate files needed for creating the device. Make sure to select the target/ABI as "Google Play" and not "Google API". It will make all the difference. In below image you can see I have 2 AVDs (Android Virtual Devices), first (andy_7) with target as "Google API" and another (nexus_5) with target as "Google Play".
Start the avd with target Google Play, nexus_5 in our case and we will get the desired result.
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.
I'm planning to build an automated system for deploying an Android build to various devices, in order to make development for multiple platforms a bit more comfortable. Is there a way to get the sdk version of a connected device through android shell or adb?
There will be a computer to which several test devices is connected, and I was planning to write a script which will fetch the correct build for each of those from a build-server, install the different apks on their respective devices, launch them and collect log info, to be made available through some other program whose specifications are beside the point.
The point is that I need to know the sdk version each device is running to install the correct apk, and I was hoping I could get this through adb, but I can't seem to find a way to access it short of building a tiny app, compatible with all versions, whose sole purpose would be to output android.os.Build.VERSION.SDK or similar somewhere my script could read it.
you can use this command:
adb shell grep ro.build.version.sdk= system/build.prop
It will output something like this:
ro.build.version.sdk=10
adb shell getprop ro.build.version.sdk
Note #Tim: this works even on phones without grep support on all host OS :-). (i.e. on old phones where toolbox does not support grep you you need to have busybox on your phone).
I also discovered a way to get the exact version of Android e.g. 4.2.2 based on the following web article http://xayon.net/looking-for-android-version-with-adb/ You need to be using a unix-like operating system - Linux and Mac OSX are fine, and windows users can use cygwin or equivalent.
At a command line:
echo version=$(adb shell getprop |awk -F":" '/build.version.release/ { print $2 }')|tr -d '[]'
Here is the result for my Nexus 4:
version= 4.2.2
I think you can by accessing the device with adb shell - change directories to position you at system and do a cat of build.prop. Here you will find for instance, ro.build.description=google_sdk-eng 2.2, ro.build.version.release=2.2 etc
I keep reading tutorials where I'm supposed to enter something into the ADB command line and that it's in my Android sdk/platform-tools. So I find it, click on it, and a black screen comes up for about 2 seconds and while it's up, it scrolls through a bunch of text. So how am I supposed to use this "adb"?
It is called the Android Debug Bridge, and the Android Developers Site documentation does a better job of explaining it than I can:
http://developer.android.com/guide/developing/tools/adb.html
If you are looking for the adb command line, navigate to <sdk>/platform-tools/ and run
adb.exe shell
from the command line.
Pretty sure that is well documented since day 1 on the Android Debug Bridge
Android Debug Bridge (adb) is a versatile command line tool that lets
you communicate with an emulator instance or connected Android-powered
device. It is a client-server program that includes three components:
A client, which runs on your development machine. You can invoke a
client from a shell by issuing an adb command. Other Android tools
such as the ADT plugin and DDMS also create adb clients. A server,
which runs as a background process on your development machine. The
server manages communication between the client and the adb daemon
running on an emulator or device. A daemon, which runs as a background
process on each emulator or device instance.
So plain old English, ADB can be found on %ANDROID_HOME%/platform-toos/, and it's this magical command line that allows you to comunicate with your mobile device, either a physical or a Virtual device (AVD), so whenever you deploy you are passing the application through the device thanks to the ADB on a specific client port on your computer to the daemon port on the device.
Interesting things you can do with it?
Logcat: ./adb logcat allows you to see the log trace of each proces.
Install: ./adb install allows you to install apk to the device.
Killing:./adb kill-sever
Starting:./adb stat-server
Enter SQLite3: adb -s your_device shell
Use the monkey: adb shell monkey -v -p your.app.package 500 to
generate random events
And a lot more! Read the documentation it's beatiful and self-explanatory.