I am trying to run "unity remote 4" test project (http://u3d.as/content/unity-technologies/unity-remote-4/7PZ) on Unity Free for Mac.
I have "Unity Remote 4" installed on Samsung galaxy.
I have android SDK installed, adb devices command returns 0019e6197e378e device.
I have turned on all necessary developer options on the phone.
When I press Play in Unity, it says accepted incoming socket.
But nothing shows up on app but the welcome screen asking me to press Play in Unity.
Here are the steps you might be missing
Go to Edit Menu:- Project Setting:- Editor.
Under Unity Remote: Device choose "Any Android Device".
Connect your android device through usb cable.
Run unity Remote on your android device.
Now press play button in unity.
It will launch your game in android device.
Make sure no android emulator (bluestack, genimotion etc) is running in background. Sometimes priority of emulator gets higher than device and operations like "Build & run" or debugging etc starts producing their outputs on emulator rather than device :)
Related
I am very new to Android development. I am trying to create and run an app from tutorial - https://developer.android.com/training/basics/firstapp/creating-project.html
But while running app it is showing me "No USB devices or running emulator detected" in Select deployment target dialog.
Background and what I tried:
I am using Lenovo K4 note Vibe.
Android version 5.1
I have enabled USB Debugging from my phone also checked "Enable OEM unlock"
I have selected USB "MTP" as connection mode when I connected my phone to machine.
I am using windows 7 and Android studio version 2.3.2
My device appears in "Device Manager" of my system i.e. It is installed properly.
When I connect my phone to my system it shows AutoPlay dialog, asking to run "Run Lenovo_suite.exe", I tried to see if my deice appears in Studio when I allow to run that app, but still no luck
I also tried by checking and unchecking "Enable ADB Integration" from Android studio, still no luck
I have already installed Android SDK for verion 5.1
I have also tried installing "Google USB driver".
I also tried connecting my device to all of my machine port
I am tried using Emulator, but it is really very slow on my machine, it takes around 2-3 hours just to boot. So, I am using my phone.
Your assistance in this matter is greatly appreciated
this problem just happen when your USB connection mode is not work in debug mode, Like:
File Transfer Or MIDI device
The Charging Only is Work in android 5 and above
GoodLuck
a addition to above answer i think if you try to debug it , you will get better result since android if had problem throw a error that says restart adb.exe ,
another thing whats your hardware config ?
and have you tried genymotion , i prefer it over android virtual device , working with a real device is better , but i prefer when to concentrate on monitor have device on it ;)
As per My experience many device not connect
So you need to try this Windows Software to detected your android phone
Install it on your windows system PDANET+
Thanks for your support guys. After 2 hours of struggle I found below:
When I connect my device to the machine, it shows me a AutoRun dialog to Run Lenovo_suite.exe(Which I mentioned in my question), but instead of auto running, I explored that newly created lenovo drive, which had 2-3 setup exe's(usb drivers and magicPlus), I installed both and restarted my machine. When I run MagicPlus software, it helped me to Authorize USB debugging with some kind of fingerprints. And now my device appeared in studio.
First of all, I'm positive that I've followed all steps in the Attaching MonoDevelop Debugger To An Android Device guide correctly (most importantly: having "Development Build" and "Script Debugging" enabled in the Build Settings).
When building & running a Unity Android app, however, my device (Samsung Galaxy S5, Android 6.0.1) just doesn't show up as a possible debug target in neither MonoDevelop, nor Visual Studio. For instance in Visual Studio, after clicking on Debug -> Attach Unity Debugger, in the "Select Unity Instance" window that opens I only see the Unity3d editor (Machine: local machine, Type: Editor). Debugging a Unity project that is run in the Unity Editor works fine, only debugging a project run on the physical android device doesn't work. It's the same for MonoDevelop.
I see the device as connected and online when doing
adb devices
I can also call adb shell commands (such as ls) on that device via command line. When I open Android Studio, I also see the device as a target for Logcat and even the just mentioned Unity Android app as a debuggable process (and when selecting it, all the correct logs that are expected from the running app).
I think it's safe to rule out a fault on the debugger side, because I tried
two different developer machines (both Windows 10 with current updates and without firewalls),
two different networks (home & university)
MonoDevelop, Visual Studio Community 2015, Visual Studio Professional 2017 RC (with respective Tools for Unity),
re-installing Unity3d,
different Unity3d projects (standard example project as well as own minimal example consisting of just a Text and a Button),
manually adding android:debuggable="true" to the project's AndroidManifest and
in Visual Studio manually connecting the debugger to the device via deviceip:5555 (in the "Select Unity Instance" Window -> Input IP).
On the device, I tried to
turning the phone off and on again,
turn USB debugging off & on,
selecting the Unity App as the "debug app" (in Developer options) and enabling/disabling "Wait for debugger" (also Developer options),
connecting the device via USB cable or via adb connect deviceip:5555 and
rooting the phone.
I don't know what else to try. I'm pretty sure it's something on the device. It has worked before, however I don't know what changed since then. Any tips are appreciated.
EDIT
Ok so I got some progress. When I examined the logcat output from the app, I found lines such as
Waiting for connection from host on [192.168.2.110:55416]...
(.2.110 being the IP of the device)
So I manually entered that IP & Port in Visual Studio in "Select Unity Instance" Window -> Input IP and right after that, the logcat read
PlayerConnection accepted from [192.168.2.115] handle:0x1c
(.2.115 being my developer machine)
So the connection is there. Visual Studio just doesn't "recognize" (?) it and doesn't switch to debugging mode so it can stop at breakpoints. Does anyone have an idea how I can force it to do so?
Well, not really an answer but I've found a way to debug it after all. Amidst all the logcat output, I've also found that line:
Using monoOptions --debugger-agent=transport=dt_socket,embedding=1,defer=y,address=0.0.0.0:56785
Taking that port (and the actual device IP) and entering it in Visual Studio in the "Select Unity Instance" Window -> Input IP, the debugger finally connected.
The problem is, that port gets changed every time the app is run so in order to debug it, I'll always have to look it up. Also (that may be a different issue altogether), the output of Debug.Log or Console.WriteLine isn't caught by the debugger. The only way to read the log for now is in AndroidStudio.
So yeah, the question still stands, how come the device doesn't show up as AndroidPlayer in the Select Unity Instance Window in Visual Studio (or according place in MonoDevelop)?
It does show up if your Android device is connected to wifi. When the app starts playing, you can see it in the "Select Unity Instance" box and then you can select it.
Now I am developing one android application. I am running my code in emulateor. Can anyone help me How to debug my own android application in android tablet(Matrix One) instead of android emulator (i.e) steps to configure my android tablet(Matrix One) with eclipse?
Thanks,
Manoj.
Enable USB Debugging from your settings (and mock locations if you need them)
Plug the device into the computer via USB
Use eclipse to run the app on the device
You're done
This part of the documentation has more details on doing this, like installing drivers, configuring UDev etc.
You might need a additional driver. You should be able to download it via the sdk.
Once the driver installed, just plug in your device after turning on the debug modus on the tablet under Application-Development. Your device should appear in the device view in eclipse. The Application should automatically be launched on the real device once plugged in.
I want to run my Android Project iwrote with emulators on my Android Device. The Device is Connected on an USB-Port. When I start the "Android Device Chooser" nothing happens. No running device in the "Choose a running Android Device"-Table is displayed.
I tried to reboot the system(PC and Smartphone) while connecting. I tried every USB mode. I tried another Device( G1 and HTC Desire). Unknown Source is always true.
I tried another Eclipse-Version(64 and 32 bit), tried another SDK(64 and 32 bit) and reinstalled the android sdk.
I still can't see any device. Everything worked fine on my old 32 bit system. Now i have to work with my 64 bit lenovo. (both windows 7)
somebody got another idea?
Thank you.
Fabian
See this link for detailed info: http://developer.android.com/guide/developing/device.html#setting-up
In short, you have to:
Mark your app as debuggable (in Manifest)
Allow USB debug on your device (Settings->Application)
And, if developing in Windows, download drivers.
Try command line "adb devices" to see if your phone is detected ok. Except limited number of phones supported by Android by default, manufacturer-supplied setup needs to be used to start usb mode. In my case, Vodafone 845, setup was contained in phone storage. So after phone was detected as normal usb storage, I located that utility and simply ran it. Then it started to be detected as android phone.
The easiest way to this dilema i found here. If you are on windows,
Make sure you have install the google usb driver
Ensure USB Debugging is enabled.
download the adbdriver setup from http://adbdriver.com/downloads/
just follow the wizard and install, automatically it should see your device or you try restarting android studio.
Enable USB Debugging :
Setting - About Phone - Tap Build Number 5 times.
Then go to : Setting - Developer Options - Turn On Usb Debugging.
Download and install Wondershare Mobile Go / Snappea. That program will download and install your android device.
If this popup appears, click allow.
Is there a way to test the application on the real device without publishing to Android market?
It can be easily done. just connect the phone to you computer, install the drivers that come with the SDK.
Now if you are using eclipse then just go to the "run configuration" of your project and select manual in the Target tab. Now when you run your application through eclipse you will get to select the device on which to run the application and there you can see your device.
Alternatively, the same can be done via command line by typing adb install <app_name> and the application will automatically be installed to you phone. While using command line make sure that you are not sunning any emulators, else adb will give an error since it will confused on where to install the application.
On a device, turn on debug mode (in the Applications menu under Settings). When you plug your device in, it will show up alongside your emulators. If you have no booted emulators, running or debugging your app will automatically default to your device.
Hope this helps!