Why Android Studio won't install my app on my phone - android

That is the error I get. I don't know why. I am connected. Well at this point I don't know if it refers to another kind of "offline" stuff.
I didn't find any answers to this specific error
09/19 02:49:11: Launching 'app' on samsung SM-J710MN. Installation did
not succeed. The application could not be installed. Installation
failed due to: 'device offline'

There are two possible reasons for this behaviour. Either your Samsung device is faulty or this is an adb issue. To confirm, enter this command into your terminal while your Samsung device is connected:
adb devices
If the result returns the name of your Samsung device, then there's probably a problem with the Samsung device.
However, if your terminal does not recognize this command, it means you have to install Samsung adb driver on your computer. This way, your computer would easily recognize your Samsung device. For Windows, there are a ton of links out there where you can download Samsung adb driver; I have not verified any of them, so you might have to do the search by yourself. Nevertheless, I hope you understand the problem now.
I hope this helps.
Merry coding!

Can you run the following codes in the terminal and share the result?
adb devices
You can also try this method
adb kill-server then adb start-server

GO to avd manager now you are able to see installed avd. from that actions select wipe data, and run your project. this Worked for me.

Related

adb error : device not found

Android ADB showing device not found error when trying to install Apk.
After installing few apk's it becomes slow and disconnects all of a sudden giving adb device not found error. Please help me with a solution.
File-> Settings -> Build, Execution, Deployment -> Instant Run
disable "Enable Instant Run to hot swap code/resource changes on deploy(default enable)
The information shared by you seems a bit generic, still you can try any of the following solutions.
Open command prompt as administrator and enter below commands:
"adb kill-server"
"adb start-server"
Install drivers for you phone if you're not testing on emulator.
Open android sdk manager and check/install "Google USB Driver" from extras folder.
I was using Windows 7 and my adb driver was not working tried everything even google driver was showing error when i updated driver that it is not compatible with 32 bit. I tried changing cables and commands but it was showing exclamation mark on ADB interfaces in other devices inside device manager. Adb devices was also not showing any devices. I installed universal adb driver and now it is working fine. Hope it helps.
Probably won't work and you already have tried it, but if no one of the previous answers help, sometimes it's usb cable's fault. Just try an other one to be sure.
I went to File-> Invalidate Cashes/Restart this fixed it for me

How do I run an Android app on my device?

RTFM is the most natural reply but I have tried that and it did not work.
This is what I have done so far:
1. Install all the necessary USB drivers from the vendor's site. The USB device is properly installed.
2. Add android:debuggable="true" to my manifest
3. Tried adb devices in command prompt and it shows the device as connected
4. Enabled USB debugging via Developer Settings
Still, my phone is not detected in Eclipse
What is going wrong ?
I am using Windows 7 32 bit and trying to connect a Samsung Galaxy S3 (GT-I9300) with the latest firmware :)
I have same issue with my Galaxy S3 (GT-I9300). I solved this issue after "Factory Data Reset". Now when i connect my phone with USB ,Eclipse shows my device perfectly.
Hope its helpful to you...
My friend had similar problem, solution was restarting adb server. Try running:
adb kill-server
adb start-server
from command line.
You could try Run-> Run Configurations-> Target in eclipse and change it to always prompt to pick device. This worked for me in the past.
I think this is due to the driver problem. Just install the drivers properly and try reconnecting it.
this is a driver for S5830 similarly you should install drivers for your device
Download Samsung Kies mini And Than Try To Connect Your Device.
Install the software Moborobo
and then
Try Run-> Run Configurations-> Target in eclipse and change it to always prompt to pick device.

My phone cannot be detected in eclipse to test run

Before asking my question, I have looked through a few threads that share the same problem as me and have tried all the given solution with no success. I am from Malaysia.
I cannot get my device to be detected to test my app on my phone. I have checked both the "Unknown sources" and "USB debugging" settings in my phone. I am using eclipse. But if I create a random virtual device, my app is able to run there.
Okay so I am using a Motorola Atrix 2. And I'm using Windows 8 Pro 64 bit
I have downloaded android SDK bundle from here : http://www.motorola.com/sites/motodev/us-en/motodev_lp.html
I have also tried downloading the latest driver with no success. I have also added this line in the manifest android:debuggable="true"
I have tried both as a mass storage device and a media transferring device.
I would appreciate any help a lot because as of now, I cannot progress further into developing an android app and that saddens me. :(
I have attached a picture of which my android phone should be detected in the window, but as you can see, none.
https://pbs.twimg.com/media/BJu1XSgCYAEGCUd.jpg:large
go to /your-android-sdk-directory/platform-tools using command prompt.
type
adb kill-server
adb start-server
adb devices
n see whether ur device is detected now or not...
Note: if you're using a Linux machine then put ./ before adb
Install proper drivers for your adb devices, from Android-SDK archive or Motorola site.
If you are on Windows machine, go to the device manager find your device, and select folder with drivers for it.
Open you windows os's explorer, have a look at the process, if there two or more process hold your adb, try to exits the process
Check that the android:minSdkVersion is lower or equal to the Version running on the phone. If it is higher it wont show on "Android Device Chooser"
Install and run programs/drivers with admin rights.
Have you installed Motorola Device Manager?
When debugging Samsung and HTC devices I got it to work by installing that kind of software (for syncing the devices to the computer).
Download from the following: ABD Universal Driver
and install it. Make sure you have your device plugged in before installing and make sure you are on USB debug mode on the phone settings.

Why does adb return offline after the device string?

I use "adb devices" to get following result. Only one device is connected to PC by USB, but we get 8 lines of result.
Could anyone suggest the reason?
WH96TNE00361 offline
WH96TNE00361 offline
WH96TNE00361 offline
WH96TNE00361 offline
WH96TNE00361 offline
WH96TNE00361 offline
WH96TNE00361 offline
WH96TNE00361 offline
Try the following:
Unplug the usb and plug it back again.
Go to the Settings -> Applications -> Development of your device
and uncheck the USB debugging mode and then check it back again.
Restart the adb on your PC.
adb kill-server
and then
adb start-server
Restart your device and try again.
To complete the previous answers, another possible solution is to change the USB socket in which your cable is plugged in.
I had this problem (with the classical answer about using adb kill-server / start-server not working) and it solved it.
Actually, it took some time to find that because Windows was correctly recognizing the device in my first socket. But not ADB. As Windows was recognizing the device, I had no real need to test other USB physical sockets. I should have.
So you can try to plug the cable in all your USB physical sockets directly available on your computer. It did worked for me. Sometimes the USB sockets are not managed the same way by a computer.
Beginning from Android 4.2.2, you must confirm on your device that it is being attached to a trusted computer. It will work with adb version 1.0.31 and above.
adb kill-server
adb start-server
that solved my problem
I've had a similar issue with one of my phones.
I was unable to connect and use usb debugging on any of my computers.
In the end, I had to restart the usb debugging on the phone manually [doing so using the Developer menu was not enough].
There's only one command you have to run on your phone [I did it using Terminal Emulator app]:
adb usb
And that was it.
Hope this helps someone in the future.
You may also try downloading newest version of adb http://developer.android.com/tools/help/adb.html
Reboot the device. This always fixes it on Mac OS, whereas adb kill-server does not.
On my Galaxy Nexus with Android 4.2.2, I had the same problem initially, 'adb devices' was showing the device but with offline status (USB debugging was initially active on my device).
These are the steps I took to remedy the situation :
Disable USB debugging (Device not connected to PC)
Re enable USB debugging
Now connect to your PC, now a pop up on the device (not on PC) will ask you for authenticating the PC, Thats it...
adb devices now lists both device id and no offline.
I post here my question just in case is helpful for somebody else.
My problem was that my colleague was connected to the same device and I was not able to connect to the same device.
Note: I had this problem with Amazon Fire TV connecting over Wifi.
There are 2 solutions:
Easy to "drop" his connection (sorry buddy :)
Restart the device
adb kill-server
adb start-server
adb connect device-ip
A bit more difficult but two clients can use the same device (use different TCP ports)
Please look at this answer
For me with Android 4.1.1 only rebooting device works
Run SDk Manager and install Android SDK Tools and Android SDK Platform-tools updates. ADB must be updated to a new version for 4.2.x
I had the same issue and none of the other answers worked. It seems to occur frequently when you connect to the device using the wifi mode (running command 'adb tcpip 5555'). I found this solution, its sort of a workaround but it does work.
Disconnect the usb (or turn off devices wifi if your connected over wifi)
Close eclipse/other IDE
Check your running programs for adb.exe (Task manager in Windows). If its running, Terminate it.
Restart your android device
After your device restarts, connect it via USB and run 'adb devices'. This should start the adb daemon. And you should see your device online again.
This process is a little lengthy but its the only one that has worked everytime for me.
Had this on client's machine it turned out he had an out of date version of adb installed via website offering adb and fastboot. The client in question didn't want to install the whole SDK because of perceived bloat :S .
So if you're seeing offline make sure you've downloaded and using the latest adb. I ended up emailing him adb executable.
Also worth checking that the adb you are using is the correct one in the Path. i.e on Mac
$ which adb
/Users/me/dev/adt-bundle-mac-x86_64/sdk-macosx/platform-tools/adb
if non of the steps work from the above. my device still offline after connected through wifi. i did the following:
go to your device...
go to settings.
go to developer options.
Allow adb debugging in charge mode only.
repeat the steps as you always do . which is:
a. connet your usb on chargemode only.
b. open command write:
- adb tcpip 4455
- adb connect 192.168.1.11:4455
b. disconnect usb.
now everythings work for me .
make sure the device is set for usb debugging
Have the adb client running (e.g. via "adb usb" or adb start-server"
LEAVE the device connected via usb!!!
AND THEN reboot the device.
This always brings my Motorola MB525 "online" again, after adb complains it would be "offline". I'm using OSX btw.
I made adb working on Android 4.4.2 with GT-N8010 (Samsung tablet) after setting device in authorized mode once upgraded adb to SDK version.
~/local/opt/Android/Sdk/platform-tools/adb
Android Debug Bridge version 1.0.32
While It did not work using :
adb version
Android Debug Bridge version 1.0.31
Shiped in Ubuntu LTS version :
apt-cache show android-tools-adb | grep Version
Version: 4.2.2+git20130218-3ubuntu23
This link may help then
Can't connect Nexus 4 to adb: unauthorized
After wasting hours on it, I have updated my version of adb and now adb devices shows my device online and I can run the app on it again.
also make sure adb isn't running in your processes automatically. If it's there right click open file location, figure out what is starting it, kill it with fire. Run the updated adb from an updated android sdk platform tools. This was the issue with mine, hope it helps someone.
What did me in is was that multiple unrelated software packages just happened to install adb.exe -- in particular for me (on Windoze), the phone OEM driver installation package "helpfully" also installed adb.exe into C:\windows, and this directory appears in %PATH% long before the platform-tools directory of my android SDK. Unsurprisingly, the adb.exe included in the phone OEM driver package is MUCH older than the one in the updated android sdk.
So adb worked just fine for me until one day something caused me to update the windows drivers for my phone. Once I did that, absolutely NOTHING would make my phone status change from "offline" -- but the problem had nothing to do with the driver. It was simply that the driver package had installed a different adb.exe - and a MUCH older one - into a directory with higher precedence.
To fix my installation I simply altered the PATH environment variable to make the sdk's adb.exe have priority.
A quick check suggested to me that "lots" of different packages include adb.exe, so be careful not to insert an older one into your toolchain unintentionally.
I must really be getting old: I don't ever remember such a stupid issue taking so endlessly long to uncover.
Check that the ADB version that you are running is newer than the version of the OS on the connected devices. For me, updating the ADB helped to get the device online.

Cannot connect Nexus One Phone to Android adb

I am running Android SDK 2.2 and am trying to get the adb to connect to the Google Nexus One phone. Its a new phone, shipped straight from Google - haven't installed any apps on it yet.
(I have Windows XP)
Here is what I have done so far:
Followed the instructions on setting up the device for development as given on the Android Developer's site:
http://developer.android.com/guide/developing/device.html
added android:debuggable="true" to my application manifest
USB debuggable is checked on the phone
downloaded the Device Drivers For Windows Revision 3 (this supports Nexus One phones)
Went through the Hardware Installation wizard to install the device - the device shows up as "Android Composite ADB Interface".
When I run adb devices on the shell, the device appears for a moment, then disappears.
On the Eclipse console, I get the following message:
[2010-11-13 11:54:42 - DeviceMonitor]Failed to start monitoring
I have rebooted the pc several times, uninstalled and reinstalled the drivers several times, but I get the same error each time. As I was researching this problem, someone had recommended rebooting the phone. I am a bit confused by that - is that a soft or hard reboot? Do I just power the phone off/on and is there something more complex involved? Do I have to hard reboot it to reset to factory version - even though its brand new?
Has anyone run into a similar problem? Any help on this would be great.
I can't test my application on the device if the adb cannot view the device. Thanks so much in advance.
I had this same problem. To get it working, do the following:
Close Eclipse
Open Task Manager and kill the adb.exe program.
Re-open Eclipse (Eclipse will automatically restart the adb.exe service)
Run adb devices from a command prompt and you should see something like the following:
C:\> adb devices
List of devices attached
0123456789ABCDEF device
Of course, I'm assuming you have your phone plugged into your computer.
It sounds like something is killing the service as soon as it starts. Try disabling any anti-virus and running adb devices again. You can also check your system logs for errors - run compmgmt.msc and check the Event Viewer's logs.
When I run adb devices on the shell, the device appears for a moment, then disappears
Do you mean Windows' command shell cmd.exe? The output of 'adb devices' doesn't update itself, it should just print out what's currently connected then terminate.
Nothing here worked for me. And you know what? I plugged it to my USB 3.0 port.
Just plug it to regular USB 2.0 and it'll work.
Hi you jst need upgrade your usb driver, follow this ref link, after upgrading you need to uncheck USB debugging, disconnect cable from device and then check USB debugging and connect cable to device again. this'll solve your problem..
link text
I had this same problem. Do the following:
Plug your phone into your computer and:
Run the command prompt.
Go to the tools location of the android sdk.
run 'adb kill-server'
then run 'adb start-server'.
Turn off COMODO Firewall and Defense+ module
I got my Nexus One on Windows 7 64 bit going by following these instructions:
http://developer.android.com/sdk/win-usb.html
Note that the directory has changed to /extras/google/usb_driver.
You know that you need to do this if you go to control panel->devices and printers and show properties on the device, and there's no driver shown.
Open the task manager by Ctrl+Shift+Esc
In the Processes select adb.exe and Click the End process Button.
Now close the eclipse and restart it again.
This worked for me. Hope this would work for you as well.

Categories

Resources