First of all, this is my first post here and I'm a beginner so my apologies if this ends up being a stupid question or my format is wrong, but any help is appreciated.
Essentially my problem is in trying to set up Unity Remote 5 for debugging in Unity. However, I believe I've finally narrowed it down. The error I'm getting now seems clear:
CommandInvokationFailure: Unity Remote requirements check failed
C:/Program Files/Unity/Hub/Editors/2019.4.17f1/Editor/Data/PlaybackEngines/AndroidPlayer\SDK\platform-tools\adb.exe forward tcp:7201 tcp:7201
stderr[ error: device offline]
stdout[]
exit code: 1
I've looked into this error and came upon this: https://stackoverflow.com/a/39031464/14948855 which seems like it might be useful to me, however the issue is I don't know how to run the commands he suggested and stack overflow made it clear it didn't want me posting a question as a response to that question and I don't have enough prestige to comment.
I'm trying to run "sudo adb kill-server" from an ubuntu linux terminal on windows from the directory abd is in (C:\Program Files\Unity\Hub\Editors\2019.4.17f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platform-tools), but it won't run.
proof command not found
I've tried adding it to the path on my computer: I added the directory listed above to "Path" in my "Environment Variables".
My phone is plugged in, I've disabled and reenabled developer mode and usb debugging, and restarted Unity and my phone several times. Any help with running this command in ubuntu or cmd, or even the greater problem of Unity Remote 5 would be fabulous.
Thank you.
Edit: here's a better image showing my issue:
image showing how I've tried to add the folder to the path but it still can't be reached
Final Update:
All my problems have been solved, here's how I got unity remote 5 for android working for posterity:
step 1) Make sure phone is in developper mode (go to "about phone" in settings, tap build number 7 times).
step 2) Make sure "USB debugging" is turned on in developer options.
step 3) Make sure Unity is updated to the most recent supported version through Unity Hub (might not be required but I did this step).
step 3) Download android support module through Unity Hub.
note: if you downloaded current Unity version from the Unity website rather than through Unity Hub, it doesn't seem to let you add modules to it through Unity Hub.
step 4) The sdk path Unity specifies by default is wrong for some reason, so in preferences->external tools, disable the default path and paste in the right directory (should be something like: C:\Program Files\Unity\Hub\Editors\2019.4.17f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK) to be safe I did this for the JDK, NDK and Gradle too.
step 5) When you plug in phone, pull down your notifications, hit "tap to change USB options" and make sure phone is in "camera" mode or some variation. For me it was "Photo transfer".
Note: if you don't have the option to change USB options, try different usb ports/cables, if those don't work you might have debris in your charging port, clean it out with a dab of 91% or 99% rubbing alcohol and a tooth brush/tweezers (this will also make charger sit more snug in phone)
That might be enough to get it working for you, if not...
step 6) (Not sure if necessary) May need to update phone drivers in device manager on windows.
step 7) If Unity gives an adb error saying too many devices connected, it's possible you have a daemon running in the background which adb is picking up as an android emulator because it's using a port greater than 5555. It seems adb checks open ports above port 5555, and assumes anything it finds is an emulator. To check this, as indicated in my original question, and as stated here: https://stackoverflow.com/a/39031464/14948855, in cmd on windows use adb devices (if ur on linux may need to use sudo) to get a list of all devices being detected by adb. (Also use "adb kill-server" to reset it.) If there is an emulator being detected, it should include the port it's using in its name, in my case it was "emulator-5562" in port 5562, which was apparently actually NTKDaemon from Native Instuments, a random music production program I've only used once so far. I'd suggest googling the emulator port you find to try and narrow down the process taking that port. The only thing left to do is to kill the process running in the port. I found NTKDaemon in task manager and also disabled it activating on startup because that's just evil imo.
And that should be it. Hope that works for you if you're here for help.
(btw in terms of my original question, I was able to access adb.exe by changing the directory in cmd, but I still never found why adding the directory to the path didn't work, so if anyone has an answer to that I would be interested)
I am stuck flashing android to my nexus 7.
Steps to build image:
branch: refs/tags/android-4.4.2_r1
lunch : aosp_flo-userdebug
What i´ve done so far after building the image:
Like descibed in docs:
http://source.android.com/source/building-running.html
sudo fastboot flashall -w -p /home/stefan/bin/out/target/product/flo/
Gives me the following error:
could not load android-info.txt: No such file or directory.
So no luck with that, tried searching google but didnt find anything.
Downloaded an official rom 4.4.2 (KOT49H) from the nexus driver page:
https://developers.google.com/android/nexus/drivers
Deleted everything in the update package (zip) and putted my files in.
Then did sudo sh flash-all.sh
This method do flash the rom onto the device, but it also wont boot.
It hangs on the google splash screen.....
Is there anybody who can tell me how to properly flash my AOSP rom to device?
Your number 2 definitely will not work, and you shouldn't bother going down that route.
So the first issue you might have is you may be trying to build the wrong image, there are two Nexus 7s. Grouper is the designation for the first generation Nexus 7 and Flo is the designation of the 2013 Nexus 7, so make sure you have those right.
The second issue you may be having is the build may be failing. Are you sure that your make completed successfully? Your final message should say something similiar to
Install system fs image: out/target/blah/blah/blah/system.img
If you didn't see a line like that your build failed in which case you should diagnose that.
The third issue is you may be pointing at the wrong file. The line you are giving expects a full package, and you may not have created one. Try doing this instead:
sudo su
. build/envsetup.sh
lunch aosp_flo-userdebug
fastboot flashall -w
This will look for the generated files from the build automatically without you having to point at them, so long as you have selected the proper lunch option. Another issue you may be having is you may be confusing your shell with sudo, I am guessing you haven't bothered setting up the proper USB Permissions (see configuring USB access on the AOSP Build Guide. If you don't want to bother setting up USB permissions, then just initialize your environment as the super user after you have built when you need to flash (not before, or all your files will belong to root!)
I compiled source code referring to http://source.android.com/source/building-running.html and downloaded apt binaries for my Nexus 4g s .I did following after building:
fastboot flash recovery recovery.img
fastboot flash boot boot.img
fastboot flash system system.img
fastboot flash userdata userdata.img
fastboot erase userdata
fastboot erase cache
Now, I cannot see anything on my phone. What could be wrong? Wasn't the source I built suitable for my device? But, I am pretty sure I have downloaded correct source code and binaries.
To rescue your device back, use fast boot to flash the factory image back.
To check why you have this issue, please check:
If you did not see ANYTHING after reboot, your boot.img (contains kernel) is not correct
If you just see the boot animation but it goes on forever, your system.img is not correct
You should:
Make sure you have download the correct source code and switch to the correct branch
Make sure you are using the correct build configuration by lunch and select correct product
The AOSP does not contains everything, you have to download or pull out from your old system to get the proprietary binaries.
I managed to get Android-x86 running in VMware player, but if I need to go to the command line by pressing Alt+F1 I cannot go back to the GUI. How do I restart the GUI from the command line?
To start the GUI, I had to select VboxVGA instead of VMSVGA in the VirtualBox display settings of the virtual machine.
Note: This is a solution to make it work with VirtualBox in case it helps someone who finds this question. It is possible that the solution to make it work with VMware player is similar.
I also found this information here:
Mandatory: Unless guest additions are installed, change the default
VMSVGA to VBoxVGA.
To fix this, you have to open the Virtual Machine Settings for your Android virtual machine and then go to the Display settings on the Hardware tab. Make sure that 3D acceleration is ticked! Start your Android virtual machine and wait maybe up to 10 seconds on the command line. It will then boot to Android GUI.
Adding another optional solution, because even though the most voted solution (written by JAGJIT DHALIWAL) helped me, it didn't do the whole job.
When trying to install android x86 8.1 (oreo) the suggested answer didn't do the trick and the my android VM was stuck on GUI initialization, after viewing this video my problem was solved.
What I had to do is:
to start the vm in debug mode, or open the CLI before GUI init first.
remount mnt: mount -o remount,rw /mnt
edit /mnt/grub/menu.lst (vi /mnt/grub/menu.lst)
appending this code to the first option (the first line starthing with kernel) nomodeset xforcevesa
save the file (:wq or :x)
reboot and the VM boots like magic with GUI
To go back to GUI try use Alt+F7
So I've thrown the book at this problem and think I've isolated the cause.
I've downloaded and installed JDK 32 and 64 bit.
I've installed the Android SDK as needed.
I've modified android_winusb.inf inside of the google-usb-driver to include the Kindle Fire device IDs.
I tried downloading the kindle fire windows 7 driver from amazon (as described in the answer here), and using that.
I tried modifying that driver to include the fire device ID in the x86 section.
I've killed and restarted adb diligently, and restarted my comp several times to see if that would magically fix it. nothing.
The only thing I'm unsure about is the modification of adb_usb.ini. Unfortunately, my .android folder doesn't exist in my %USERPROFILE%, but instead exists in another location on my computer. That folder doesn't have adb_usb.ini either. So I copied the contents of .android to my %USERPROFILE%, and created adb_usb.ini in each, and added 0x1949 to that empty file.
This did not work. adb devices still turns up zilch.
I think adb is having trouble finding my adb_usb.ini, but really, I have no idea. And if that is the case, I don't know how to fix that. Help?
Just adding 0x1949 to the adb_usb.ini was enough for me.
Make sure that you have added the right product/vendor id in adb_usb.ini file.
I had the same exact problem only after adding 0x1949 I could see the device listed.
Either amazon is changing the id's or people are giving wrong id's in random forums. The first one is definitely not required.
After adding the product id's my adb_usb.ini looks like this and I don't think your .android location matters
0x0e79
0x006
0x1949
This was driving me crazy also. Did recommendations from other links and posts and did not work. After running adb command without options, I saw an option for usb. I executed the following:
adb kill-server
adb usb
you should see some output after this, I didn't save the results
adb devices
Now showed my device
Type out your adb_usb.ini
cd /users/username
type adb_usb.ini
Make sure it shows 0x1949... mine had a special character instead of the x. Edit the file and change it manually to an x.
your device driver is not working go to the following link and update
http://www.jayceooi.com/2011/12/13/how-to-install-kindle-fire-adb-usb-driver/
Also double check that Windows isn't being sneaky and actually saving your adb_usb.ini as adb_usb.ini.txt when you create the file from scratch!
In my case, Windows was using the default driver. I uninstalled the windows driver.
Installed the driver at \android-sdk\extras\amazon\kindle_fire_usb_driver. Ran the following:
adb kill-server
adb usb
You should see some output after this, I didn't save the results:
adb devices
Device finally showed up. Kindle then showed up in device manager. Was not showing up there before.
In the %android_sdk%\extras\amazon\kindle_fire_usb_driver folder you can find KindleDrivers.exe file. Just run it and Kindle drivers for Windows (Win7 in my case) will be installed.
That sounds like you've done all the right things. For me the adb_usb.ini file did the trick and it's in c:/users/dirk/.android/adb_usb.ini. Oddly, I also added the product id of 0x006 on another line, thought I don't think that matters (the 0x1949 is the vendor id).
Make sure the adb_usb.ini is in the same folder as your avd folder. You can try creating a new AVD and look around to see under which user the new one was created.
Hope this helps.
So I had the exact same problem as you and I also had a problem with it looking for java.exe in my c drive instead of my d. I fixed this issue the same way I fixed that. Use the "mklink" command line tool to create a symbolic link in the C drive to your .android folder on your other drive. My exact command was:
mklink /D .android D:\.android
I was in my C:\Users\<User Name>\ folder
After that I ran adb kill-server and adb devices again and it showed up!
Hope that helps.
Adding this worked for me
0x1949
0x006
The main issue here is simple: for some reason when you install the drivers, the version of adv_usb.ini in the user/.android does not contain the vendor ID
I've check and the file was plain.
All that I had to do was to copy the ini file from the driver folder into username/.android and do a adb kill-server, followed by adb usb and the device was recognized.
In general, running "android update adb" from the /Tools folder should be enough to update the correct adb_usb.ini file. The location of this file is relevant as adb will only look for one of them. I had a CRC error in sdkuilib.jar, and it would not copy. This caused "android update adb" to fail, so my adb_usb.ini file did not get updated.
Also, when I went to update by hand, I was logged on as joe user, but I elevated to admin user to perform the update. I modified the joe user copy of adb_usb.ini (c:\users\JoeUser.android\adb_usb.ini), but the adb program looked instead at the admin copy of adb_usb.ini (c:\users\Admin.android\adb_usb.ini). So, adb did not see the 0x1949 that I added by hand.
Once I replaced my copy of sdkuilib.jar (by redownloading, installing in a separated folder, and copying over the bad file), I was able to run "android update adb" and 0x01949 showed up in my admin adb_usb.ini. [To find this, I changed echo off to echo on at the top of both the android.bat and find_java.bat files.]
After that, I did an adb kill-server and adb usb. But I still got the "error: device not found" message. Only then did I notice that my Kindle Fire had timed out. I turned it back on, unlocked it, and at that point, the kill-server "adb usb" sequence produced "restarting in USB mode".
Once that output was produced, the adb devices showed my Kindle Fire.
I had this exact issue for the longest time - Michael's answer lead me to the answer that fixed this for me.
If you don't currently have a C:\Users\[Username]\.android folder, add one manually. Copy adb_usb.ini into this folder. Windows may give you some trouble if you try to create this folder in Windows Explorer (beginning the folder with a period, probably). I had to open cmd and type move android .android to accomplish this.
After doing this, adb devices immediately showed the device.
For future readers' reference:
Don't forget to turn on USB debugging on the device. (At least in my case, on OUYA, this is disabled by default.)
If you are using Windows and you have the Android SDK installed (if ANDROID_SDK_HOME environment variable is set) then adb will use %ANDROID_SDK_HOME%\.android\adb_usb.ini instead of %USERPROFILE%\.android\adb_usb.ini
Also this post has a command to populate your adb_usb.ini with Vendor IDs of all currently connected adb devices.
In my case, I had to install Kindle Fire drivers.
If you can't find it in your local disk, you can download from official Amazon page:
https://developer.amazon.com/public/resources/development-tools/ide-tools/tech-docs/05-setting-up-your-kindle-fire-tablet-for-testing
Direct link:
https://s3.amazonaws.com/android-sdk-manager/redist/kindle_fire_usb_driver.zip