I am unable to run my Android application on the emulator from Android Studio on macOS Mojave. But I have no problem running the same application using the physical device connected to the USB port. I think the problem might be that the emulator is not authorized to access the webcam of my Macbook Pro. On the terminal:
$ emulator -webcam-list
List of web cameras connected to the computer:
Camera 'webcam0' is connected to device 'CC24342DY7CF6VVDK' on channel 0 using pixel format 'YUYV'
But when I start the emulator on the CLI, I have this message:
$ emulator -avd Pixel_2_API_29
emulator: WARNING: Camera name 'webcam0' is not found in the list of connected cameras.
Use '-webcam-list' emulator option to obtain the list of connected camera names.
There is an issue here about this problem: https://youtrack.jetbrains.com/issue/IDEA-219288
But my terminal is authorized to access the webcam. I can run other applications accessing the camera from the CLI without a problem.
So I think this is something wrong. Any suggestion?
Note: Currently, MediaRecorder does not work on the emulator.
This has nothing to do with macOS security.
https://developer.android.com/reference/android/media/MediaRecorder
Related
Google Chrome can't detect my device using chrome://inspect/#devices.
But both adb devices and Android Studio can detect it.
Google Chrome Screenshot
adb devices output:
List of devices attached
58H3Y18807006304 device
I tried reinstalling chrome, tried removing all apps and extensions but nothing worked.
But when I loaded Ubuntu on Virtual Box and connected my phone in the VM, then chrome inside Ubuntu VM detected my phone.
Please help me.
See Remote Debugging WebViews ...
unless setting WebView.setWebContentsDebuggingEnabled(true); the debug bridge won't connect.
Another possible cause are local ports having non-default values, which may require port-forwarding.
This would at least list the local ports in use:
sudo lsof -i -P -n | grep 127.0.0.1
I have a project using ionic framework, I am working in command line and I am trying to run my app on on a real device phone, a Wiko Rainbow.
I have enabled On-device Developer Options and I also have enabled USB debugging option and the target device is never recognized. I am working on Windows 7.
I have done: ionic run android
And the result:
No target specified and no devices found, deploying to emulator
Is my device phone phone compatible with ionic or am I missing sommeting ?
I manage to find the solution I had to the environnent variables path:
<my pc>\AppData\Local\Android\sdk\tools;
<my pc>\AppData\Local\Android\sdk\platform-tools;
Then I update the driver of my device thanks to this link: Android development driver for Wiko or other phone on Windows 7
A few time later my phone asked me to accept the connexion with my computer and I managed to run my application.
Then I update the driver of my device thanks to this link: Android development driver for Wiko or other phone on Windows 7
A few time later my phone asked me to accept the connexion with my computer and I managed to run my application.
Is anyone else having a difficult time getting their device when running an application in Android Studio on a Mac.
Nexus 6 settings:
USB debugging: turned on
USB computer connection: Tried both 'Media device (MTP)' "Lets you transfer media files on Windows, or using Android File Transfer on Mac)" as well as to Camera (PTP) Lets you transfer photos using camera software, and transfer any files on computers that don't support MTP.
-Android version: 5.1.1
I also attempted on my 2013 Nexus 7 running Android 5.0.2
In an attempt to troubleshoot I also tried setting an environment variable for tracing and received the error cannot bind 'tcp: 5037'
./adb kill-server
set ADB_TRACE=all
./adb nodaemon server
I'm happy to report back after two weeks of troubleshooting and talking with the Android Studio team I have fixed this issue with a simple factory reset of the Macbook Pros' OS.
When I type adb devices -l this is the output:
$ adb devices -l
List of devices attached
VS9854G22b261d6 offline
I think that VS9854G22b261d6 is my phone. I had to install LG drivers before that would show up.
It seems like the solution to that "offline" problem is to update the android sdk. But, cordova requires an older SDK (api version 19, right?) So how can I make both adb and cordova happy?
I'm on Windows 8.1 and I have a Verizon LG G3 device. I have enabled USB debugging on the device. When I type cordova run android it starts the emulator and deploys to that. I am expecting this to deploy onto my connected device instead of onto an emulator. The "hello world" app deploys fine to the emulator, but I'm trying to deploy it to my device and I can't figure out why it's not even trying to do that.
When I type cordova run android this is the output:
...
BUILD SUCCESSFUL
Total time: 2 seconds
Built the following apk(s):
C:\...\cordova\platforms\android\ant-build\CordovaApp-debug.apk
WARNING : No started emulators found, starting an emulator.
Waiting for emulator...
### Error: could not find emulator icon resource: android_icon_32.png
In my case, I plugged into a different USB port and then it said "unauthorized". I changed the USB connection to camera and then the device asked me to authorize it. Then adb devices said "device" and cordova run android worked as expected. Seems to be a ton of different solutions to the same problem. This is all I needed.
I've setup an Ubuntu 12.04 LTS 64-bit VirtualBox guest running on a Windows 7 host (also 64-bit) with the sole purpose of Android-based hacking, programming, debugging, etc. I've followed numerous guides and forums in order to have my VBox guest recognize my physical Android device via USB, but I keep getting the following error pop-up:
Failed to attach the USB device motorola XT926 [0228] to the virtual machine Android.
USB device 'motorola XT926' with UUID {REDACTED} is busy with a previous request. Please try again later.
Result Code: E_INVALIDARG (0x80070057)
Component: HostUSBDevice
Interface: IHostUSBDevice {REDACTED}
Callee: IConsole {REDACTED}
I've tried the following:
Note that I've already uninstalled VirtualBox, reinstalled the latest version, installed the VirtualBox Guest Additions as well as the latest expansion pack
Shutdown VM
Plug in Android device via USB and allow Windows to recognize it
Run "VboxManage list usbhost" to confirm that the device is being recognized by VBox and listed as "Available"
Edit VM settings to enable USB Controller AND USB 2.0 (EHCI) Controller.
Add filter for Motorola device (VendorID = 22b8) and set Remote option to "Any"
Unplug Android device
Start VM, login and wait for it to "settle"
Plug in Android device
I've also tried the following:
echo Y into the old_schema_first config
create 70-android.rules with the appropriate SUBSYSTEM, ATTR and MODE values set
The guest VM still does not recognize the Android device and abd doesn't list any when I issue the adb devices command.
Any help here would be greatly appreciated.
If your device support adb wireless debug (like Nexus), use that. If not, you can install adbWiress, this app makes your device debugable through wifi (need root).