How to run app on moto 360 from android studio - android

I'm using the sample watchface app and have followed all the steps
(developer.android + several variations from this site) to run something on my watch but with no joy. Wondering if anyone can advise please.
Phone (moto 4G) is connected to PC by USB. USB debugging is on in Settings and Debugging over Bluetooth is on in Android Wear app. Paired watch (moto 360 2gen) has ADB Debugging enabled and Debugging over Bluetooth enabled.
Android Studio lists the phone if I run the phone module part of the app; it offers no compatible devices if I run the wearable module. Adb devices command just lists the phone. On the phone in the Android Wear app under Debugging over Bluetooth it says
Host: disconnected
Target: connected.
When I look on the phone in Settings, Apps a watchFace app has appeared but there's nothing on the watch (tried to change watch face, nothing new; no new app).
I tried
adb forward tcp:4444 localabstract:/adb-hub
adb connect localhost 4444
but the second command gives
'unable to connect to localhost:4444 ... no connection could be made because the target machine actively refused it (10061).'
I also tried
adb connect 127.0.0.1:4444
which does connect but AS says it's offline.
Can anyone help?

After trying the above procedure many times it seems that sometimes it works and sometimes it doesn't! I haven't yet found what makes the difference but suspect either (a) not leaving enough time between connecting phone and entering adb commands or (b) simple PC running too slowly.

Related

React-Native physical device not connecting to server

Here's whats happening-
react-native run-android fails giving the following error message-
"
Execution failed for task ':app:installDebug'.
com.android.builder.testing.api.DeviceException: No connected devices!
"
Here's a list of things i have done-
Connected my phone (Redmi Note 7 pro) to the laptop (uses ubuntu 18.04) using a usb cable. And followed all instructions from the react-native documentation (USB debugging etc) but the device (phone) doesnt show on using the command adb devices . I have also tried connecting the phone as a file transfer device and every other mode possible.
I have tried connecting via the wifi network (which works) but the last time i did it i had to turn off MIUI optimisation, and this led to whatsapp going haywire and i had to reinstall whatsapp. From what i know this is a necessary condition, if wireless connection is to be made to an MI phone.
Android emulator..... simply doesnt work (i have tried many SO tricks, none worked).
So is there a way to solve these issues? or is there any other method using which i can run my react-native application for debugging.
Thanks in advance :)
Ensure that Developer mode is enabled with USB debugging in the device. If USB debugging is enabled then the device id should be listed in the adb devices list. If not then try to add ADB driver for the device or a universal ADB driver.

How can I develop my own apps for the Huawei P30 Pro?

I have been developing some apps with Xcode for my iPhone but recently I got the Huawei P30 Pro and would like to start making my own apps for it.
I've tried Android Studio for Mac but it doesn't detect my phone plus google doesn't show any results for developing apps for the Huawei.
Is it possible or is there nothing I can do as of now?
I've enabled USB Debugging on the phone and run 'ads devices' which shows my device as connected but still noting in Android Studio.
You may have accidentally revoked access to debugging try turning debugging off and back on again you NEED debugging for any form of android development. as for no documentation, that is OK your phone is new and there will not be much info on the specifics, just google stuff about android development in general.
If Android Studio doesn't detect your device, you may want to try using wifi to connect the device, I use AS on a mac every day, and the devices I have often disconnect when cabled, but with this they stay connected for days.
Connect device via cable.
Open terminal / preferred command line app.
Run command adb devices. If no device detects unplug and try again, if it continues with no device then check settings on device that usb debugging is enabled, and enabled in charging mode.
If device connected:
if only one device, run adb tcpip 5555
if multiple devices run adb -s deviceid tcpip 5555
If successful then disconnect the device
Run command adb connect 192.168.x.x:5555 with x.x being your device IP address.
If that's all done and it says connected, then you should see it in AS.

USB Debugging over Wifi

I am unable to debug over wifi.
I have followed below steps.
Go to Android Sdk-> Platform-tools and type cmd
run adb tcpip 5555
adb connect and MY IP ADDRESS
Now i got the result show in below Image.
After my device is connected. I removed my USB cable then i got device list empty.
I have no idea why this is happening.
I have motorola X play Mobile Phone Android 6.0 and having Windows 10 operating System.
Need Help.
For simple one click connection of ADB over wifi - You can try using the Android ADB Plugin from JetBrains. The plugin will internally handle all the setup and you can click-away and connect to adb over wifi without worrying about anything else. Steps to install and use can be found on its GitHub repo page.
Provides an action which allow you quickly connect your Android device
over WiFi to install, run and debug your applications without a USB
connected by pressing one button. Connect your device using a USB
cable and press the Android WiFi ADB button. Once the device be
connected over WiFi you'll see an IntelliJ/Android Studio
notification. Now you can disconnect your USB cable and enjoy
deploying, running and debugging your applications over WiFi. The
version 2.0 enables a window to check which of your devices are
connected or not and connect/disconnect it manually if needed.
Screenshots from the plugin page:

Debugging in Android device over wifi without rooting [duplicate]

This question already has answers here:
Run/install/debug Android applications over Wi-Fi?
(41 answers)
Closed 6 years ago.
Is there any possible way to debug or run android apps from eclipse to my Sony Tablet S over wifi rather than USB without rooting the device?
There are ways to do it, if the device is rooted. However, I am seeking the solution in a device that is not rooted.
Disconnect device from usb then tell it to listen on 4455
adb tcpip 4455
restarting in TCP mode port: 4455
connect to the device using a specified ip:port. my device is using wifi
adb connect 192.168.1.103:4455
connected to 192.168.1.103:4455
now do normal adb commands over tcp like
adb shell
when your done, you can put it back in USB mode
adb usb
restarting in USB mode
After a bit of dabbling with testing I successfully managed to connect a Sony Tablet S over ADB following this procedure, when both the computer and the tablet were on the same wifi network. I used an Xperia T as a tethering point between a laptop and the Tablet S. I followed the same procedure on an Xperia Tablet S and an Xperia S as well.
Connect the Sony Tablet S through USB to a computer, make sure you have ADB debugging enabled on the tablet.
On the computer, execute "adb devices", verifying the tablet is showing up in the list of available devices.
Execute "adb tcpip [port]" while the tablet is connected to the computer, verifying you get a response "restarting in TCP mode port: [port]"
Disconnect from the device from the computer it was connected to.
From a host located on the same wifi network, execute "adb connect [ip to device]:[port]", verifying you get a response "connected to [ip to device]:[port]"
In the end I launched Eclipse, created a test project and tried launching the project. The project installed and launched automatically from Eclipse. I also tested this for debugging and that worked equally well.
Finally After lots of search, here is the consolidated, short tutorial about "Wireless Debugging with Android without rooting" your android phone.
Steps:
Make sure your Phone and your PC/Laptop is connected in the same network.
Find your Android Device's IP Address: Go to Settings > About Phone > Status. Note down it.
Ping Test: Lets first check if your phone is accessible from your PC/Laptop to do this ping your Android Device and check its response. See Notes if ping is unsuccessful.
e.g: ping 192.168.1.55
Connect your Android Device Via USB in USB Debugging Mode.
Open command prompt and cd into <Android SDK Folder>\platform-tools directory and run the following commands.
adb tcpip 5555
adb connect DEVICE_IP_ADDRESS_HERE:5555
If you want to switch back to USB mode, use the following command.
adb -s DEVICE_IP_ADDRESS_HERE:5555
Disconnect Android Device from USB. If everything is fine, you can Wirelessly debug your Android Apps!
Notes:
If ping is unsuccessful, Make sure Wireless (WiFi) devices and wired devices are not isolated. If Isolated, you need to disable isolation. Router Mfgrs calls it as AP Isolation. There will be a setting in Router's Wireless Configuration page. I have D-Link Router, I unchecked the Enable MultiAP Isolation setting in Wireless Basic Setup Page.
I personally felt this method of connecting is taking more time.. so, I configured my android device so it uses static IP like 192.168.1.55 to connect to my router and I made a windows batch file like below,
#echo off
cd C:\AndroidSDK\platform-tools\
echo make sure your your Phone is connected in USB Debugging Mode.
pause
adb kill-server
adb tcpip 5555
adb connect 192.168.1.55
pause
so, every time I have just need to plug in my device, and double click the batch file and all done automatic :P !
(No root required) There is one best, easy and with UI method for Android Studio
IntelliJ and Android Studio plugin created to quickly connect your Android device over WiFi to install, run and debug your applications without a USB connected. Press one button and forget about your USB cable.
just install plugin Android WiFi ADB
Download and install Android WiFi ADB directly from
Intellij / Android Studio: Preferences/Settings->Plugins->Browse Repositories
.
Remember! for first time to initialize the device you must have to connect using usb
Alternatively, you can download the plugin from the JetBrains plugin site and install it manually in: Preferences/Settings->Plugins->Install plugin from disk.
for more information read here https://github.com/pedrovgs/AndroidWiFiADB

Android tcpip ADB session disconnects when accessory is attached

I am developing an ADK application using Windows 7 x64, API 15 with a target of an Acer Tab A100 running Android 4.0.3 and an Arduino with a USB shield. The tablet is not rooted.
I am able to successfully setup ADB to run over tcpip using the following command in a Windows command shell:
adb tcpip 5555
adb connect X.X.X.X
I then disconnect the usb cable from the Windows 7 PC and connect it to the Arduino. The Arduino is running the ADK code and the tablet prompts to launch my application. The application launches and runs fine. However, when the Android application launches the ADB session terminates and I have to re-execute the adb connect command to re-establish it.
This doesn't seem like it should be happening. Does anyone have any thoughts how to fix it?
Thanks,
digitalhack
ADB server can be started from android ADK based application, it will communicate with firmwate in the Arduino.I developed one project using ADB communication with Arduino, work fine.
Thanks
It shouldn't be necessary to use ADB for app communication over USB. I'm deep into this right now and am trying to get openAccessory to work for this exact purpose (communicating with Arduino). openAccessory causes the Android device to operate in "device" or "slave" mode, permitting the Arduino to be run in "host" or "master" mode. Since the USB host is the one that powers the USB bus, this permits the Arduino and its (presumably) more powerful power supply to power the Android tablet rather than the other way around.
Read up on openAccessory mode in the Android API, and report back on your results!

Categories

Resources