I'm trying to run an ionic app on my mobile phone (Android 4.4.2).
USB-Debugging is activated.
When i run the command "ionic emulate android" everything works fine and the app is opend in the emulator.
But when I run the commad "ionic run android" I get following warning:
WARNING : No target specified, deploying to emulator
and the app is started on the virtual device...
Shouldn't the app run on my mobile phone? What am I doing wrong?
How can I specify the target?
P.S.: When I copy the .apk file to the phone I can run the app.
I had another developer tool opened (Chrome Inspect) and it "ate" the connection. In my case, just closing the Chrome Inspect panel and running ionic run android worked.
I solved the problem.
Here is what I did:
I typed into the command line: adb devices (located in the "platform-tools" folder in the Android SDK) which returned me an empty list.
So I installed my phone's drivers, which I downloaded from the vendors homepage.
Now the list contains my device and the app is started on my mobile phone.
I had a different problem, with a very simple solution.
When plugging in your Android device for the first time, it'll ask you to trust the computer's certificate. That popup screen disappeared on me, as I was just getting a call.
Simply unplugging/replugging your phone and accepting your computer's certificate should do the trick!
Once you've enabled your device for debugging, make sure to turn on usb tethering on the device;
Settings > Tethering & Networks > USB tethering
This fixed the problem for me.
In my case I had Android 5.1.1, and below are the steps I took:
Please check that your PC recognizes your phone (you can access the files like in a USB flash drive). If not please install the drivers from google here.
Please check that the USB debugging options is checked on your phone, then:
1- Go to Setting -> General -> '{} Developer options'
2- Look for the 'USB debugging' option
3- If the 'USB debugging' option is disabled then turn off 'Developer options' and turn it back on. Now you should be able to check the 'USB debugging' option.
None of these worked for me on android 6.0 on a mac.
I found this article: http://trendblog.net/android-file-transfer-not-working/
quoting from it:
Enable Developer Mode by going to Settings > About Phone (at the very bottom usually) > press on Build Number repeatedly until the pop-up appears
Go to Settings > Developer Options
Enable USB debugging
I'm on a Mac.
What worked for me was to heed the warning on the device that said no program on the Mac was available that could connect to the device, such as Android File Transfer.
I installed that. Unplugged and replugged the USB cable. And voila.
I had two problems (Ubuntu OS):
I had a connection open with chrome//inspect - close that (simply close the tab)
I missed the dialog that appears when you connect your device through USB cable. You must trust the computer.
Now run the command cordova run android and look at your device there another dialog will be appeared click ok, now you are done! In the terminal you will see LAUNCH SUCCESS. By the way I removed the old app from my device too.
No target specified and no devices found, deploying to emulator
When this message appears, you have to click START, and activate your emulator before.
If your app is already installed in your device and your device debuging is already enabled.
Then uninstall the previous app and install the fresh apk
sudo ionic cordova run android
Once you are remove the USB plugin from the computer means it will not work. Already open the Chrome inspect in your PC means close that tab and run.
In my case, just closing the Chrome Inspect panel and running ionic cordova run android worked.
Thats all. Enjoy your coding
I got the solution by removing the Android emulator and re-create the emulator from AVD Manager of Android Studio.
Related
I am using Android studio 3.4.1, In which my projects are not running in real device. but not having any problem in emulator.
After connecting the usb and i have run the app. then getting this error. after that device is not even listed in the available devices.
error got in logs:
Installation did not succeed.
The application could not be installed.
Installation failed due to: 'device '711KPMZ0603459' not found'
Retry
Retry also not working.
I also tried in Android studio Beta 1 and Beta 3. same problem happening.
can any one help me in this?
FYKI:
1. USB debugging enabled.
Tried USB option for File Transfer, USB tethering, No data transfer.
Tried with different cable as well.
Problem identified only after updating 3.4.1 android studio. Also facing in 3.5 Beta 1 and Beta 3.
Same kind of problem already added in Issue Tracker. https://issuetracker.google.com/issues/122892907
Kill and Restart the adb manually through Terminal using below comments. use cd to go inside platform-tools under Android sdk folder.
./adb kill-server
./adb start-server
PS: Before posting this questing here, i already tried quitting the adb in Activity Monitor (which can be opened from spot light)
Activate USB-Debugging in Developer Options and set your USB options from Charge phone to transmit Data.
Well the mark of your phone is important because in my case i use LG G5 and i could not see my device even after turning on developer mode and enabling debugger options.
I don't know the type of phone you use but you can try my solution.
After turning on USB debugging, go to tethering under the networks sections and turn on USB tethering then try again.
Hope It helps!
I have Android Studio on Windows 8.1 and I want to run my android app on my Samsung Galaxy S7 phone.
Here are the details:
USB debugging in my phone is ON
adb version is 1.0.36
Under Device Manger -> Portable Devices -> My Phone, the status is 'The device is working properly'
I also installed Google USB driver in SDK Tools
My desktop can detect my phone since I can read and write files using Windows Explorer
I tried the following but still, adb devices still does not recognize my phone.
Tried USB Configuration MTP
Tried USB Configuration PTP
Tried using different USB cables
Tried restarting Android Studio before and after I plug my device to my desktop
Did I miss any configuration? Any help is appreciated!
Thanks!
I too had the same problem.
I tried the following and it worked.
Make sure Developer options and USB debugging is enabled on your device
Then on your Windows system.
Open device manager and locate your device's ADB Interface Driver
Right click and choose properties
Check in the general tab if your device is working properly
If it is not enabled then go to Driver tab and select enable
You may have to try enabling your device a few times(7-8)
If this works then you may see the below message on the General tab
This device is working properly.
You need to restart your computer before the changes you made to this device will take effect.
And that's how I made it work.
install drivers for your device and enable developer mode for your device
While the simple answer here is enable debug mode and install drivers, I think the answer should mention that if nothing works , do install google drivers. I stumbled on a video explaining the same, so adding the link here.
https://www.youtube.com/watch?v=asbkkV-IIZc
It helped fix my issue with oneplus device. Also, I could get the google usb drivers from android studio > sdk manager > sdk tools section.
Hoping to save someone else's time.
If you entered command adb devices in cmd and don't see your device ID, you can to open Windows Task Manager and close adb.exe task. Then you need to open again cmd and enter adb start-server and check devices again.
If you don't see your device ID after all then maybe problem in phone or drivers.
I found the answer here
I just need to install Samsung USB driver and it worked fine. I guess the Google USB driver did not work for me.
Also, I didn't know that I need to install a USB driver even if I can already read/ write files to my phone when I connect it to my desktop.
In Device Manager, I was looking at the wrong device (Portable Devices). I should have been looking at Other devices and there I can see that the Samsung phone has no drivers installed.
Thanks!
I had the same problem. Just try another USB port on your computer.
rebooting of the android device worked for me. Also, try to use the port USB 2.0
I was also facing the same issue on my MAC-OS. Restarting the MAC fixed the issue.
I also installed Android File Transfer to check if this was only a debugging issue or if it was an issue with the connected devices. Even AFT wasn't working so it was definitely not a debugging issue.
I also got this message on launching Studio after restarting the MAC.
sometimes windows firewall prohibit the adb.exe in platform-tolls folder
first check your phone and be sure about "usb debugging" is "on"
check that Default USB configuration is on "transferring files"
if you checked 1,2 but the problem is not solved you should reinstall platform-tools from "SDK manager" then "SDK tools" uncheck "Android SDK platform-tools" click apply then reinstall it by check "Android SDK platform-tools"
I've followed the instructions at google: https://developer.chrome.com/devtools/docs/remote-debugging. I've also went over the troubleshooting section - but nothing seems to work.
I have samsung galaxy 3 (android 4.1.2, chrome 42.0.2311.111). USB debugging enabled. I've tried restarting the device after ticking the USB debugging a few times.
On windows 8 I run chrome (44.0.2388.0 canary). I've installed Samsung USB Driver, and my computer can see my device.
I do not get any notification when plugging the device nor when opening canary with the inspect page.
Did I miss anything?
Try these steps:
Download and install Android SDK
Open SDK Manager.exe
Select Android SDK Platform-tools and press Install packages...
Open a command prompt and execute these commands:
cd C:\Program Files(x86)\Android\android-sdk\platform-tools (or C:\Users\User\AppData\Local\Android\Sdk\platform-tools)
adb.exe devices
You should receive a response like this:
List of devices attached
ABCDEFG123 device
If your device is listed check if Chrome detect the device, otherwise try to execute this command:
adb.exe kill-server
adb.exe start-server
adb.exe devices
Check again if Chrome detect the device.
If your device is not listed at all after executing adb devices command there is something wrong in your configuration (e.g. incorrect or missing drivers?)
Hope this helps somebody else...
This happened to me because I was trying to Chrome inspect a release build (Ionic; i.e. ionic build android --release). If I build a debug app (ionic build android), I am able to see the app from the chrome inspection tool without any issues.
Google play does not like debugable apps https://developer.android.com/studio/publish/index.html
which is needed for the inspection - see this SO link: debugging an ionic app for android platform hence proper releases won't appear in the Chrome inspection.
In my case the problem was solved changing the usb connection mode in the settings of the Android device to "Camera (PTP)" . For some reason the usb debbuging did not work when connection mode was set to MTP.
This looks like a bug in Chrome or in Android. This helped me: on your android device select USB connection settings (popup which is open on cable connect). It has MTP/PTP/charge modes. Switch between MTP/PTP and back.
Download and install Android SDK
Open SDK Manager.exe
Select Android SDK Platform-tools and press Install packages...
MTP -> PTP
So I started getting errors in my ADB logs which, I think, are causing my device to now display any logcat output for my app. I am getting all the logcat output except the one from the app itself.
PropertyFetcher: AdbCommandRejectedException getting properties for device 04799057970ed1fc: device offline
PropertyFetcher: AdbCommandRejectedException getting properties for device 03799467970ed5fg: device unauthorized. Please check the confirmation dialog on your device.
you have missed the Fingerprint Certificate Authorization dialog in your phone when you connected it, try to change the USB mode to Media, or another different than the one you have in and then reconnect your device, or go to Developer Options -> Revoke USB Debugging and reconnect, watch for the dialog and click on accept, that should solve your problems.
If that doesn't work, set your ANDROID_SDK_HOME again, and then:
Unplug device
Run:
adb kill-server
adb start-server
Plug in device
I experienced the same issue.
To ensure that your Android Device is expecting the correct fingerprint from the system (e.g. after switching Android SDK installations -> different adb server running!), do the following (actually, this did the magic for me):
unplug your Android Device
revoke USB debugging authorizations in Android Developer Options
plug your Device. You can accept the fingerprint once more.
1) Go to Phone Setting > Developer options > Revoke USB debugging.
2) Turn off USB debugging and Restart Again.
It will work definitely, in my case it worked.
Please check this.
https://code.google.com/p/android/issues/detail?id=82850
I faced the same issue. Could notice that the "adb integration" was disabled. Please enable it at your IDE (Tools | Android)
This happened to me because I enabled usb debug previously on another pc. So to mke it work on a second pc I had to disable usb debugging and re-enable it while connected to the second pc and it worked.
The solution to this was just to change the USB cable, having enabled
ADB Integration via
Tools >
Android >
Enable ADB Integration.
Below are the commands for Ubuntu user to authorise devices once developer option is ON.
sudo ~/Android/Sdk/platform-tools/adb kill-server
sudo ~/Android/Sdk/platform-tools/adb start-server
On Device:
Developer option activated
USB debugging checked
Connect your device now and you must only accept request, on your phone.
In my case, it was literally a bad USB cable. Apparently it was right on the edge - adb logcat would work, but about half the time I would get this error when trying to push an app to the device.
Changed to a different cable, and everything was fine. The old cable was also very slow at charging, so I should have suspected it sooner...
Remove the Debug permissions on the Device, with the cell phone connected, then put them back, and ask if you want to allow the PC to have debug, accept and ready permissions: D
I had the same problem when debugging over wlan. I could launch the application from Android Studio but couldn't get any messages in logcat.
I fixed it by connecting the device to my pc via USB cable, launched the application once and everything was working. Then I disconnected the USB cable and tried debugging again via wlan and everything was working again.
I've got the same message too.
In my case, I have changed my dev environment to another notebook pc and my device is samsung galaxy note 2014 edition.
My OS is windows 7
My galaxy note condition listed as following
developer option activated
USB debugging checked
The error message was "device unauthorized. Please check the..."
In general, the location of the default android setting was C:/Users/Your_login_name/.android then I copied and pasted all files in the '.android' folder to my new pc's setting folder.
After that the problem was gone.
I think the problem was adbkey file mismatched.
Also, I didn't have any menu name such as revoke adb authorization.
Seems strange the intricate cable&restart solution steps ... The first time I've plugged the Android device to my Ubuntu (15.10) I've got Connect as: multimedia or camera options and in my Android Studio the device status was unauthorized. It wasn't until I choose between one of the options that I got in the Android device the PC authorization option. When you give the proper permissions in Android then the device status changed to online in Android Studio. Cheers
This might help -
Just Download and install the Android SDK version(same as your mobile's android version), then run.
In my case the problem was about permissions. I use Ubuntu 19.04
When running Android Studio in root user it would prompt my phone about permission requirements. But with normal user it won't do this.
So the problem was about adb not having enough permission.
I made my user owner of Android folder on home directory.
sudo chown -R orkhan ~/Android
Download platform-tools-latest-linux.zip.
Run:
unzip platfo*.zip
cd plat*
./adb devices / ./adb usb / etc
I get this error very often for some reason when doing "ionic cordova run android" and running on an emulator. What works for me is to end the "adb.exe" process and re-run. Sometimes that also doesn't work and what I do is exit the emulator and in android studio do a "Cold Boot" on the emulator.
in Linux i had to delete the content of .android folder which holds the adbkey and ofcourse enable USB Debugging.
I had the same issue despite:
developer options enabled
USB debugging enabled
Solved by simply unplugging and then replugging the USB.
I am not able to resolve this simple issue.
I am trying to connect my device to Eclipse via USB cable.
On my PC, I have installed Eclipse and the Android SDK and running the program on the emulator is working fine.
I have downloaded and installed Samsung Kies on my PC. It shows my device if connected via USB to the PC.
But I dont know how to connect the device with the emulator.
Connect means, I want to run the Eclipse code on my device instead of emulator. I am using Samsung Galaxy Ace GT-S5830i. Please help me out to resolve this issue.
Comment is lack of formatting so i add an answer.
Check if your computer had your phone driver. I assume that your use Windows. Open Device Manager
At a command prompt, in the Start Search box, or in the Run box, type the following command: mmc devmgmt.msc
. Other ways : check link
If you find your phone name or ADB Interface so you got driver. Try to restart DDMS or restart your Eclipse.
If you don't find your device or see something Other device with yellow question mark so try to install driver by browsing on your phone to Settings - Developer Options - Enable developer option - Enable USB debugging - Plug your phone to computer. Windows will ask you to install driver.
3, Update Google USB driver in Android SDK Manager (in Eclipse) or search Samsung Galaxy Ace GT-S5830i driver
4.Some weird case i got on some device.
Nexus S: disable Developer option. Restart phone. Enable again. Windows ask to install driver or you will see it in Eclipse.
HTC phone or Samsung : change Connectivity Option on phone to Charge only (Swipe status bar. Check notifications displayed). Some phone set it to some kind of Sync data so Windows can not recognize device.
I think your emulator is in Automatic. You can change that to Manual.
Try this,
Step 1
Go to Run Configuration
You can see three Columns Android,Target and Common.
Step2
Select the Target
Step 3
Choose Always prompt to pick device.Click Ok
Step 4
Now run your project you should see the emulator and your device. Select your device and click ok.
Hope it helps.
Source.
Troubleshooting
This all sounds very straightforward, but there are countless quirks and hard-to-diagnose problems that can make connecting a device much more difficult than it sounds. In this section, we'll run through a checklist of things to try when your device isn't registering.
Check that USB Debugging is enabled. This setting can inadvertently (and perhaps even automatically) change when you plug/unplug your device from your machine, or when you reboot your phone.
Check your device while it's connected to your machine. Is it asking you to choose between different modes? Some phones have a 'charge only' mode that can prevent Eclipse from recognizing the device.
Choose a connection type
Make sure you don't have an Android Virtual Device running in the background.
Could there be a problem with the USB cable? If you have a spare cable to hand, plug it in to rule out a fault with the cable itself.
Double-check you're running the correct driver. Even if you are, some devices have all the required software pre-installed (for example, HTC Sync) and downloading drivers from another location can muddy the waters. If this might be the case with your device, try uninstalling the driver from your machine and reinstalling the software from your device's memory.
Does the driver require supporting software? Samsung Kies on Windows requires .Net Framework 3.5 SP1 or above, for example. This is usually installed along with the driver, but there's no guarantee.
Running the Android Debug Monitor tool (monitor.bat) has been known to kickstart Eclipse into recognizing a new device. Connect your device, locate monitor.bat (android-sdks/tools/monitor.bat) and double-click to open. This will open the Android Debug Monitor, a stand-alone debugging tool that lists connected devices.
Android Debug Monitor
A running adb.exe process can interfere with the connection. Close Eclipse, and open the Task Manager by pressing CTRL, Shift and Esc. Find the adb.exe process and kill it. Launch Eclipse and try again.
Check that your 'Project Build Target' is compatible with the Android version on your device. You can check what version of Android your device is running by opening 'Settings' and selecting 'About Phone,' followed by the 'Software information' option if available. If you need a reminder of your project's build target, ensure the project is selected in Eclipse's 'Package Explorer,' open the 'Project' menu and select 'Properties.' If the 'Android' tab isn't selected by default, open it and the Build Target will be displayed.
Have you enabled USB debugging in your device?? You can find it in your device
Settings -> Developer Options -> USB Debugging.
The android app you have created will be a .apk file, generated by eclipse, during a successful Run. Find the .apk file from the eclipse project explorer or by tracing your workspace. Copy the .apk file to your memory card (via USB or a card reader) and install it.
You should also enable the "Unknown Sources" option under "Security" of your Android device.
If you have required options enabled on your phone (USB Debugging and Unknown Sources) you can try do this. On your computer open command console. Using cd navigate to your android sdk installation folder. Go to platform-tools. You should have there adb file. Run this
./adb kill-server
and then
./adb start-server
Then check plugged devices
./adb devices
First, you are not connecting device with emulator. What you want is eclipse to identify your device and use it for development.
Everything about using devices for android development is given in official documentation.
You have to put the phone in 'debug' mode - I don't have the instructions handy (but you can search here or on the android site for the info you need).
Also check for THIS.
Try right clicking the project -->Run As --> Run Configurations then select target and choose always prompt
On your device turn on debug mode
Now try running project
I am assuming you don't mean connecting the device with the emulator but connecting the device to your computer so you can debug it and run applications directly from Eclipse to the device. In which case KIES by Samsung will not help you at all. What you need is the Android USB Drivers provided in the Extras tab in SDK. Sometimes the installation will bug up because you didn't run SDK manager as an administrator so make sure you do that. When all of this is done make sure your device is unconnected to your computer and then reconnect it after the drivers are installed. You should be prompted with a new device installation wizard which you must accept. Additionally, you should have debugging enabled on your device, and as an extra step you can setup launching as a manual configuration but it is not needed.
To enable device debugging
Settings -> Developer Options -> USB Debugging.
For more information visit here
BTW : If the Google USB Drivers don't work you might need to install the specific Samsung drivers which are located here
Goto -> Setting -> Application -> Development -> USB Debugging
Enable it and try.
I know this is a little old, but I was having the same issue. I tried all the options of setting usb debugging (off), disconnecting, restarting phone, usb debugging (on), connecting the phone and it just wouldn't connect.
I ended up installing the latest version of Kies on my machine and added the Unified option at the end of the installer and I then the phone would connect. (Not sure i needed the unified option) but it worked for me.
I tried all the above but it didn't helped me. I did couple of things additionally
Since my mobile device is Android, I unchecked Unified option from Kies installer. This is the crucial thing that helped me solve my problem
I restarted my mobile phone.