FAQ Database Discussion Community


Using adb with multiple devices with the same serial number

android,adb
There are two devices connected with my computer.But when I start the adb, two of them have the same serial number "0123456789ABCDEF". When I try to install an APK, the installation fails with "more than one device" error message. In addition, I am developing a Bluetooth app, I need to...

LG Device Android USB Driver Issue

android,adb
I am using LG Optimus G. ADT shows that my device is offline and version is unknown as seen on the screenshot. I am sharing my device manager look also. It is installed but i think it is not properly working. I don't want to ignore that matter it is...

Different screen sizes and resolutions on Nexus 10 emulator

android,cordova,android-studio,adb
So I'm build a Cordova app, and just like everyone else, I've run into the issue of testing on different Android screen sizes and resolutions. Other SO answers have pointed me here which looks pretty promising, except for the fact that I don't have a Nexus 10. So my plan...

adb copy apk from system/app using pull command [closed]

android,apk,adb
it is possibile to copy with the command pull an apk from /system/app/ ? I would copy the player music of my samsung and make the porting of xperia z, it possible this?

Android studio not recognizing my device

android,android-studio,adb,nexus-7
I know this question may sound like a reiteration of all the other similar ones, but unfortunately none of the other solutions are working. Problems: 1.ADB doesnt show my nexus 7 (4.4.2) in devices connected. 2.When I go to search drivers from a lsit there is no Google Inc or...

sed does not quit when used along with adb logcat in a script

android,sed,adb,android-logcat
This is a follow-up question to the solution provided in this page This is the code in my script: cmd = "adb logcat | sed -n '/pattern1/p;/pattern2/q'" getLogs,error = subprocess.Popen(['/bin/bash', '-c', cmd], stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate() adb logcat | sed -n '/pattern1/p;/pattern2/q' works fine in the terminal, but sed does not quit...

android - Problems installing apps on 100´s of devices using Ubuntu and ADB

android,ubuntu,adb
I´m new to the forum and I hope I placed my Question in the correct place. I had written some scripts using Ubuntu 14.04 and Android Debug Bridge to automatically configure 100´s of Android Smartphones. To achieve that I used an udev rule to identify if an USB device is...

Problems connecting Android device and running adb commands

android,cordova,adb,ionic-framework
I'm developing an Ionic-framework app, and I have troubles running the command ionic run android which runs the apk directly on a connected Android device, it just does nothing, like in this question: Ionic run android seems to work, but the app is not launched on the phone, why? So...

How to authorize and accept ADB RSA key with broken touch screen on Android

android,adb
My Nexus 7 2012 has a broken touch screen so I use an OTG mouse with it. I recently had to do a factory reinstall so am running v5.1 lollipop. The problem is I now have to re authorize adb with my computer so I can do work on it...

Turning off ADB over WiFi through ADB shell?

android,shell,adb,android-developer-api
I would like to turn off enabled ADB over WiFi from inside ADB shell after executing a shell script before it. The main reason is that I simply want to start some script, and get rid of overhead caused by ADB over WiFi connection. I do need a WiFi connection...

ADB doesn't see my tablet

android,adb,tablet
I'm trying to use my tablet for compile with Eclipse but ADB doesn't see my devices. I have driver and I checked it a lot times. Reinstall ADB and Google USB drive from eclipse but the result is same.

How to read a text file from SD card in Android device through command prompt?

android,adb,command-prompt,android-permissions
There is a folder called "D_Permision" SD Card and there is a text file called "permission.txt" in it. I want to read this text file through command prompt and display its content in the command prompt(Not in a separate file) When I use adb pull permission.txt /sdcard/D_Permission it gives following...

Android Studio doesn't show my sony xperia tipo

android,android-studio,adb,avd
Android studio doesn't show my device to debug apps. Everything is installed and working properly except android studio. Adb driver is installed and i tried apkinstaller software, it show my device. My device api level is 15 and api installed in android studio is 21. Any one have idea may...

Nexus 7 shows offline under adb linux

android,linux,adb,rsa
I just got my Nexus 7 today, and I am trying to root it using adb. It always shows my nexus as offline. I have tried updating my adb (It is version 1.0.31) I do have usb debugging enabled, I have tried reconnecting it to different usb ports. It has...

app show up only after reboot - adb push command

android,adb
When pushing an apk-file to my samsung galaxy s3 through the command adb push myapp.apk data/app the app does not automatically shows up - as it does when compiling and uploding it through Eclipse. I have to restart every time What is the problem?...

ADB Bluestack - Connect 2 PC

android,adb,bluestacks
I've two PCs, say PC1 and PC2. I've Bluestack installed in PC1 and I've Android Studio Installed in PC2. So my question is : "Is it possible to connect the Bluestack emulator with the ADB installed in PC2 ? NOTE: PC1 and PC2 are on the same network....

getting cellular network status via ADB shell

android,adb
Is it possible to check via ADB if the phone is connected to a cellular network? I had a look at ConnectivityManager, but it is for android application development....

Android keeps asking for adb permission

android,adb
I have this weird issue, that whenever I connect my phone to my computer the computer will always ask for the phone's adb permission, even though I mark the "Always allow from this computer" option everytime it asks. I tried the following things, but none of them worked: Revoke USB...

Android Device has no Serial Number

android,adb
I have been trying to get adb to recognize my Huawei 8150 Ideos Android Device, flashed with CyanogenMod 7.2.0, but currently, it only shows $> ./adb devices List of devices attached ???????????? device Which is an issue because it prevents me from using the automated deployment mechanisms of IDEs like...

Android ADB connect over TCPIP not working

android,adb
I Connected my moto g2(Lollipop) to adb over WIFI using the commands adb tcpip 5555 adb connect 192.168.2.6:5555 It was successfully connected when i checked how many devices are connected. It was showing 2 devices. 1.Device over USB Device over WIFI with the IP address So i need to use...

Android: Cannot read from external storage and cannot create folder in /storage/sdcard0

android,command-line,adb,android-5.0-lollipop,android-externalstorage
I have mounted an external ext4 hardrive from the device tree /dev/block/sda1 to /storage/emulated/legacy. My mainActivity is trying to access a file under /legacy/data/abc.txt. However it cannot get to it. The owner of /legacy/data is root. Also, mainActivity tries to create a folder under /storage/sdcard0/results called folderx using foldername.mkdir(), but...

Adb shell getevent method returns twice the value for X and Y on Nexus 4

android,adb,screen-size,nexus-4
I am currently trying to generate a complex gesture via the sendevent command of adb shell. In order to replay a gesture, I recorded the events via the getevent method of adb. Here is a sample of a simple tap on the bottom right of my Nexus 4 screen. /dev/input/event2:...

What is the difference between screenshot and screencap in adb shell?

android,adb,screenshot
I have a Galaxy S i9000 with CyanogenMod 10 on it which supports both of these commands in adb shell and both take screenshots. They look a little different however. Using adb shell screenshot: And using adb shell screencap: It seems that adb shell screenshot takes only one colour channel,...

How to run an app when it does not show under Apps?

android,debugging,install,adb
I used ant to build my Eclipse project from the command line in a debug configuration. (Eclipse Luna and Android NDK-R10d is broken, so I can't use Eclipse any longer. Confer, Eclipse/ADT plugin cannot locate symbols for r10d NDK). I then performed an install using adb: <Project Directory>$ adb install...

Android /system/framework/*.jar files

android,adb
I did ls -al /system/framework/ on my Android 5.0.1 phone via adb shell I noticed about 95% of the .jar files there were 309 bytes. After pulling one such file using adb pull and unzipping them showed the .jar file only contained /META-INF/MANIFEST.MF Where is the actual dex code of...

Run adb commands with NSTask

objective-c,cocoa,adb,nstask,nspipe
I'm building a simple GUI to run ADB commands in Cocoa. I have found a few different articles saying how to run shell commands using NSTask, but nothing specific to ADB, and I'm having trouble understanding. I can run simple ADB commands, e.g. - adb devices - adb reboot Function...

adb devices - No device attached

android,eclipse,adb
I need to see my Nexus 7 on the adb devices list. Although I enable the "" USB debugging "" on the device, but when I try to see the "" adb devices "", then no device is attached? ...

How to record Android device's screen on Android version below 4.4 (KitKat)

android,adb
With Android version 4.4 (KitKat) one can record Android device's screen with following command using ADB from commandline. adb shell screenrecord /sdcard/demo.mp4 But this only works in Android version 4.4 (KitKat) and 5.0 (Lolipop) Is there any other command or a way to record a video below Android version 4.4...

Getting a white screen with my installed app in Android emulator (however works in browser)

android,cordova,android-emulator,adb
I am having issues getting a legacy mobile app to run in an emulator - it all seems to run in the browser without any issues but when I run the cordova emulate command the app attempts to install but I always get a white screen (nothing else) & the...

Open Chrome with ADB

android,adb
I used to able to launch Chrome using ADB like this: adb shell am start -n com.android.chrome/com.android.chrome.Main But now when I try it, I get: Starting: Intent { cmp=com.android.chrome/.Main } Error type 3 Error: Activity class {com.android.chrome/com.android.chrome.Main} does not exist. It seems that the Main Class name has changed. If...

adb screencap output is different than on the device

android,opengl-es,android-ndk,adb
I have a graphical glitch related to blending in my OpenGL application using Android NDK. The strange thing is that when I take a screenshot through adb screencap command, the problem completely disappears and the result looks okay. My question is: Is there a way to know what is happening...

Is there any difference between adb wait-for-device and adb wait-for-devices?

android,adb
There are two commands that I used wait for a device to come up: adb wait-for-device and adb wait-for-devices. Both seem to wait for a device to boot up, I din't find any difference in their behaviour. Is there any difference in their behaviour? Adding more information on what I...

adb connection in Android with multiple system

android,eclipse,adb
I have one Android phone device and I want to run my android application from two different windows pc with eclipse. How it possible to run an android application in one device from two different eclipses?

how to use adb and meteor at the same time

android,meteor,adb
It seems that Meteor CLI doesn't play nice with ADB. After using ADB commands, for example adb logcat, running meteor run android-device meteor doesn't find the connected android device: ERROR: Failed to launch application on device: ERROR: Failed to install apk to device: ERROR: Failed to deploy to device, no...

adb.exe not found after installing Android Studio

android,adb
I installed Android Studio 1.2.1.1 and also created virtual device. I am trying to install one app (APK file) through command line but I could not find adb.exe file on my machine. Please help where should I look for adb.exe file on the machine.

Android ADB Wireless Scan

android,adb
Is it possible to do a wifi scan with android adb/shell? I have a Nexus 7 unlocked and rooted with Super User and busy box installed. I can turn the wifi on or off, check the state, and get the current connected network, but cannot seem to find something that...

Debugging a WebView (Ionic) app on Android via logcat

android,cordova,adb,ionic-framework,logcat
There are several questions about the subject, however not one of them seems to address the particular problem I'm having. I'm developing an app with Cordova/Ionic, and printing debugging info I was outputting with console.log() by using adb logcat CordovaLog:D *:S was working just fine until some updates. Now I...

Android TV ADT-1 adb connect port changed?

android,debugging,adb,android-tv
Hi as of yesterday I was able to build and push apk files to the ADT-1 Android TV device via WiFi. Then the device had an update and now i'm no longer able to connect to the device. I think the port number adb is allowed to connect on has...

Propper configuration of Android Studio on Ubuntu

ubuntu,android-studio,adb
I was thinking that I did a proper installation of Android Studio on Ubuntu, but now I need to run the adb install it says: The program 'adb' is currently not installed. You can install it by typing: sudo apt-get install android-tools-adb The thing is that I have ~/Android/Sdk/platform-tools/adb on...

Installing ADB interfaces

android,adb,hardware
Good Day I have this affordable Vodafone 890N manufactured by Yulong, I'm trying to use it to debug my android applications but for some reason i cannot find the appropriate abd driver online. if there's anyone who was able to get one for their devices, please share the link with...

Error on running “adb shell wm density 240” for changing Android device density

android,resize,screen,adb
I want to resize the screen on Android device. When I run the following commands: adb shell wm density 240 or adb shell wm size 800x480 I get error: /system/bin/sh: wm: not found. Why? How can I resolve that? I should mention that my device is rooted and its model...

If I issue 'adb shell screencap /storage/sdcard/file. What type of file the result is?

android,adb
In adb shell, screencap -h tell me: usage: screencap [-hp] [-d display-id] [FILENAME] -h: this message -p: save the file as a png. -d: specify the display id to capture, default 0. If FILENAME ends with .png it will be saved as a png. If FILENAME is not given, the...

Extracting device name of a string

java,adb
I'm trying to extract device name for android using "adb devices" command .. successfully by using this method I got that: public void newExec() throws IOException, InterruptedException, BadLocationException{ String adbPath = "/Volumes/development/android-sdk-macosx/tools/adb"; String cmd = adbPath+" "+"devices"; Process p; p = Runtime.getRuntime().exec(cmd); p.waitFor(); String line; BufferedReader err = new BufferedReader(new...

cannot get this adb shell am start line to work

android,adb
I am trying to launch this app on my emulator.. Here is my adb shell am start line C:\Users\harvey\AndroidStudioProjects\Sunshinea1>adb shell am start -n com.example.harvey.Sunshinea1app/com.example.harvey.Sunshinea1app.MainActivity WARNING: linker: libdvm.so has text relocations. This is wasting memory and is a security risk. Please fix. Starting: Intent { cmp=com.example.harvey.Sunshinea1app/.MainActivity } Error type 3 Error:...

Android Studio pm install aborted

android,android-studio,adb
Im trying to run an application on my GS5 from android studio and Im getting this: Waiting for device. Target device: samsung-sm_g900v-f3af9744 Uploading file local path: D:\Android\Projects\TestProject\build\outputs\apk\TestProject-debug.apk remote path: /data/local/tmp/com.brian.testproject Installing com.datascan.mobilescripts DEVICE SHELL COMMAND: pm install -r "/data/local/tmp/com.brian.testproject" Aborted It seems to be copying the file to the device,...

How to unlock android phone through ADB

android,adb
My screen is dead and I want to unlock my phone so I can access it through Kies to backup my pictures. I locked the phone through Android Device Manager setting an easy password (was hoping for an Unlock option once I locked it) and tried various methods to unlock...

Use CreateProcess to execute ADB command

c++,adb,createprocess
I want to use CreateProcess() to execute an ADB command that launches an application/activity. It works using the simpler system(command) function, but I want to eliminate the creation of the command line window by system(). Below is what I have right now. I have tried using different CreateProcess()es, like CreateProcessW...

adb push very slow from virtualbox ubuntu to android device

android,ubuntu,adb,virtualbox
Now I am developing some codes in virtualbox ubuntu machine, and the host machine is win7. When the codes are ready, I put the library to the device using the following command adb push abc.so /data/local/tmp/myabcfolder. However, the speed of transferring data is so slow that the shell almost stops....

How to know various activities in an android application

android,shell,android-activity,adb
I want to see activities of an app downloaded from play store. Basically I want to know the activities of an app so that I can start that application from an android phone or adb. So far I learned that to start an application we can use, $ sudo adb...

Android copy sqlite database from pc to device

android,database,sqlite,adb,root
I want to use a database I have on my pc in my android project. To archive that, I have to copy the database into the /data/data/xxx.xxx.xxx/databases folder. How can I do that? I read of using adb but I think you require root to access the /data/data folder. Is...

Android uptime in hour

android,adb,android-shell
I connect all our android devices through adb with WiFi. I am trying to get the uptime in hour. what i got now is in seconds. adb connect 172.16.100.2 adb shell cat /proc/uptime > "C:\TimeLog.txt" (or just adb shell uptime) adb disconnect The result is 258521.25 1019421.93 (or uptime: 2...

execute adb shell input swipe command from apk

android,shell,apk,adb
I am trying to execute swipe command from my Apk using process = Runtime.getRuntime().exec("adb shell input swipe 250 300 -800 300"); but nothing happens and no error occurs during runtime. Do i have to add anything in manifest to get it to work?...

Programatically disable System Bar (Have Root access)

android,adb
I am able to disable the System bar using the following adb command using a terminal client: adb shell service call activity 42 s16 com.android.systemui However, I want to achieve this programatically. I looked up how to execute adb commands programatically and found below code: Process process = Runtime.getRuntime().exec("your command");...

Static BroadcastReceiver not Working after Installation from ADB

android,android-intent,broadcastreceiver,adb
I working on a project that need to launch an app by broadcasting a customized intent "com.example.demo.action.LAUNCH" via adb. My plan is to statically register a broadcast receiver "LaunchAppReceiver" that will launch the app when receiving the customized intent. I installed the .apk by calling adb install -r <pakcageName> then...

Unable to install apk using adb on device upgraded to Android Lollipop

android,adb,android-5.0-lollipop
I’ve recently upgraded one of my Android devices to Android Lollipop (5.0) and now I can’t debug my application and even install apk on the device using adb. I receive the following error java.lang.UnsatisfiedLinkError: No implementation found for java.lang.String android.os.SystemProperties.native_get(java.lang.St ring, java.lang.String) (tried Java_android_os_SystemProperties_native_1get and Java_android_os_SystemProperties_native_1get__Lj ava_lang_String_2Ljava_lang_String_2) at android.os.SystemProperties.native_get(Native Method)...

How to give root permission for Catlog on Android

android,adb,logcat,android-logcat
I was trying to capture logs on my unrooted phone using Catlog. But I couldn't get the logs from the app that I am debugging because because Catlog don't have root permission. Is there any way to enable this permission?

adb- Is there a way to simulate IME_ACTION _DONE?

android,adb,calabash-android
Can you simulate IME_ACTION_DONE commands on the adb shell? I have used this but it does not work adb shell input ime IME_ACTION_DONE I am trying to use this system command on my calabash test by running the above command using the system function...

How to use ADB to show javascript errors when programming with Apache Cordova?

javascript,android,cordova,adb,android-logcat
I'm studying new Cordova 5.0. I'm using Sublime Text. So I'd like to use adb from command line to logcat to debug javascript errors. do you know wich combinations of parameters to use? I tried adb logcat *:S CordovaLog:D as seen in a blog, but in case of JS no...

ADB echo gives “No such file or directory”

android,echo,adb
I'm trying to write text to a file with adb and stumble on some problems. If I do it in two steps, like this: adb shell echo "hello" > /sdcard/temp/hello.txt it works. But if I try to do it on one row like this: adb shell echo "hello" > /sdcard/temp/hello.txt...

Android M Device loses authorization repeatedly

android,adb,usb-debugging
I'm running the Android M developer preview on a Nexus 5 and I keep running into an issue where my device loses its USB authorization over...and over...and over...and it's making it really difficult to continue testing. Has anyone experienced this?? I've tried plugging into different ports (USB2.0 and 3.0) I've...

How to disable battery charging during ADB connection?

android,usb,adb
Problem description: Each time wen I connect USB cable between PC and my mobile phone the battery automatically is charged. I want to use ADB protocol but I don't want to charge my battery during ADB connection. Is it possible to to turn off this charging? And ofcourse how can...

get android OS version of device connected via adb [duplicate]

android,shell,adb
This question already has an answer here: Android ADB commands to get the device properties 1 answer Anyone knows whether one can use adb or adb shell commands to get attached emulator/device OS info, i.e. API version. Thanks....

Android shell commands not working (adb Ubuntu)

android,adb
adb sentevent adb input event Above event are not working. But 'adb getevent' works properly. while using input tap the android os restarts, and no response while using adb sentevent...

How to get Signature hash code of a phone app via adb on pc?

android,adb,signature
For example, in an android program, I can do it like this: android.content.pm.Signature[] sigs = pkm.getPackageInfo( "com.test", PackageManager.GET_SIGNATURES).signatures; But, how can I do it via adb on PC?...

Launch App via adb without knowing Activity name

android,android-intent,adb
From the post Is it possible to start activity through adb shell?, we can start an Android app via adb by adb shell am start -n yourpackagename/.activityname But is it possible to start an Android app via adb without knowing the Activity name? For example, by sending the android.intent.action.MAIN intent...

Getting single line from CMD response c# and put it into textbox

c#,winforms,cmd,adb,redirectstandardoutput
So I want to get the response of adb devices put through a cmd window and then to show up in a text box. At this moment in time I have this code: Process process = new System.Diagnostics.Process(); ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo(); startInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden; startInfo.RedirectStandardInput = true; startInfo.RedirectStandardOutput...

ADB not responding with Android Studio on Windows 8

android,intellij-idea,android-studio,adb
I have already seen & tried all existing questions related to ADB not responding and yet I have been unable to fix my problem. This is the message I keep getting in Android Studio: And here are the running processes in my Task Manager: Can someone guide me as to...

Command line Logs in Android Studio

android-studio,adb
I'm using Android Studio to build an Android app. Is there a windows to show up which adb command lines the Android Studio are currently using? For example, when the Android Studio is launching the app to the device or the emulator, the windows will show up the adb commands...

Does logcat log errors that are 12 hours old?

android,adb,logcat,android-4.4-kitkat,reboot
This morning my Samsung Galaxy Mega 6.3 (Android 4.4.2) rebooted suddenly. I was not doing anything at that time, and it was the very first time when it did that. I managed to pull out a logcat using adb, but about 11 hours later. Also, I don't think that logcat...

adb shell command from batch file

android,shell,adb
I have a .bat file that runs script for testing an app and printing the log to file i have all the commands i tested them manually. Problem: after entering the command adb shell, the shell opens in the command prompt. I wrote the next commands that are entered in...

Android studio logcat not working

java,android,android-studio,adb,logcat
There is very awkward thing I am facing logcat is shown in debugging application but while running(not debugging) application it is not showing logcat . I tried restart it but nothing is happening....

Error when trying to use Android systrace.py on Linux Ubuntu

android,python,linux,adb,systrace
I am trying to run Systrace but I get an error when I run the command. [email protected]:~/Android/Sdk/platform-tools/systrace$ python Python 2.7.6 (default, Mar 22 2014, 22:59:56) [GCC 4.8.2] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> [email protected]:~/Android/Sdk/platform-tools/systrace$ ls AUTHORS prefix.html systrace.py LICENSE suffix.html systrace_trace_viewer.html NOTICE systrace-legacy.py UPSTREAM_REVISION...

Android 5.1 on emulator always offline

android,build,adb,emulator
I build Android 5.1.51 and try run it on Emulator. But adb always shows that device offline and after 2 minutes list of devices becomes empty. build target is aosp_x86-eng Camera not work. Internet not work too. Gallery always crashes what am I doing wrong?...

How does adb -e uninstall package detect emulators? In-depth emulator detection

android,android-emulator,adb,emulator
I was told that running command "adb -e uninstall com.example.myapp" works specifically with emulators because of the "-e". How does ADB know that the device is an emulator? Is there any source code available for this? I am trying to find a more in depth way to detect emulators that...

How to Enable USB Debugging on Nexus Player? (Android TV)

android,adb,google-cast,android-tv,nexus-player
I am trying to debug my app on the Nexus Player hardware. I enabled the developer mode, turned USB Debugging on, and connected the cable. However, I don't see any message like the one below as stated here: https://developers.google.com/cast/docs/android_tv#adb-usb In the Allow USB debugging? dialog, select Always allow from this...

Trying to execute procrank from cmd promt, but not working

android,shell,adb,dumpsys
I'm trying to get memory info which is allocated by my specific application using "adb shell procrank". But when i'm trying to execute the procrank command from cmd promt its giving me error like "/system/bin/sh: procrank: not found". I cant guess what it means! Thanks in advance....

What does 'adb remount' do? When is it useful?

android,adb
Should adb remount always be run before adb push? What does adb remount actually do?

Using ADB shell in C++ program

android,c++,linux,shell,adb
I'm am working on a project that requires me to make adb shell commands. The code below is just a test program so that I can understand how to pass adb shell commands from C++. When I run this code I get the following error: sh: adb: command not found....

How to read Android properties with Java

java,android,shell,adb,getproperties
I use 'adb shell getprop' in the terminal. What interfaces can I use in Android JAVA to get the same information? I have tried several things like: Properties sysProps = System.getProperties(); But I don't think these are the same properties I am looking for? Specifically, I want to find values...

Computer not finding Google Glass fastboot driver

android,adb,google-glass,fastboot
I'm trying to use the fastboot mode on my Google Glass device in order to root the device. However, when I start fastboot mode using adb reboot bootloader from the command prompt, my computer can't find the driver, so I can't send fastboot commands from my command prompt. I've tried...