Search Unity

Unity Remote does not work (android sdk problem?)

Discussion in 'Linux' started by JJ_FX, May 27, 2019.

  1. JJ_FX

    JJ_FX

    Joined:
    Mar 19, 2015
    Posts:
    76
    Hi,

    So I cannot get to work Unity Remote... I think this is related to android sdk. Im using the one from Android Studio. As the one from unity does not recognize the default one as an adroid SDK anyways...

    I can do build and run, in the meantime I will get error that "Android emulator-5554 is offline". Then I have to run
    adb kill-server and then adb devices, retry and it builds and run well on my device.

    However this not work for unity remote... Any ideas?

    OS: Pop!_OS Ubuntu 19.04
     
  2. senkal_

    senkal_

    Joined:
    May 22, 2018
    Posts:
    86
    Hi @JJ_FX
    The part about killing/restarting services, what version of Unity do you use?
    I remember some topics and it was explained that some of these issues could be fixed in Unity 2019.x versions.
    If you don't use this one, could you check?
    If you use 2019 then probably raising a new issue is a good idea or maybe it is already reported.
     
  3. JJ_FX

    JJ_FX

    Joined:
    Mar 19, 2015
    Posts:
    76
    Im using 2019.1.4f1

    Yeah... my bug reporter is not working too o_O Its closing itself while typing/pasting text. I think thats Qt problem. Reported that already :)
     
    Last edited: May 29, 2019
  4. b1oki

    b1oki

    Joined:
    Dec 21, 2018
    Posts:
    7
    Using Unity Hub 2.0, Unity 2019.3.
    SDK and NDK packaged with Unity are useless.
    Unity Remote 5 works after update SDK via Android Studio (setup path in SDK Manager to ~/Unity/Hub/Editor/..sdk)
     
  5. senkal_

    senkal_

    Joined:
    May 22, 2018
    Posts:
    86
    That's interesting.
    I didn't switch to 2019 yet but will check in few days.
    Will take a look if something is already reported, if not will raise an issue.
     
    b1oki likes this.
  6. JJ_FX

    JJ_FX

    Joined:
    Mar 19, 2015
    Posts:
    76
    Yeah that didnt work too :(

    Its pretty much annoying that I can do build and run but cant just play in Unity Remote
     
  7. JJ_FX

    JJ_FX

    Joined:
    Mar 19, 2015
    Posts:
    76
    So I didnt try on a different device, because this one (samsung galaxy tab 4 SM-T330) worked well on windows. I managed to run once or twice unity remote like a week ago, but since then nothing. And this is a new linux computer rig, so I just assumed that the issue is with linux and/or unity build.

    But today I tried on a different device (HTC desire 820) and Unity Remote works without any issues.

    So its something about samsung tablet.... Well I guess problem solved!
     
  8. JJ_FX

    JJ_FX

    Joined:
    Mar 19, 2015
    Posts:
    76
    Well... And Unity Remote stopped working again...

    It looks like while the system recognize the new device it has no problem running. But once it got recognized (played few times, restarted machine in the mean time) Unity Remote does not work anymore....

    This is getting more and more frustrating...

    EDIT:
    So since I run out of the devices to test this out... What I did was:
    1) reset one device to factory settings. Then install Untiy Remote, enable usb debugging. Run unity and pressed Play. At this time my device runs the game as expected.
    2) Reboot the machine (computer). Run Unity Remote on a device I just used, open unity and pressed Play. And at this time my game does not launch on a device anymore...

    Sooo confusing....
     
    Last edited: Jun 2, 2019
  9. JJ_FX

    JJ_FX

    Joined:
    Mar 19, 2015
    Posts:
    76
    Ok I have found a temporary fix. So after rebooting I need to clear all data used by Unity Remote. Not sure why reboot (computer, not android device) makes a difference, but it does. Loading one unity session after another I didnt run into problems as long I didnt reboot between them. And even changing the project does not affect the "issue". Rebooting android device does not help as well btw. Anyways...

    To do this:
    - go to Apps
    - find Unity Remote
    - depends on an android version, but something like:
    ---- Clear Data - eg Samsung Galaxy Tab 4
    ---- Force Stop - eg. HTC Desire 820

    After clearing cache I can go back to Unity and Unity Remote will work again!!!
     
    Last edited: Jun 2, 2019
    -chris likes this.
  10. JJ_FX

    JJ_FX

    Joined:
    Mar 19, 2015
    Posts:
    76
    And again having the problems... Clearing cache doesnt help now too...

    Eh... looks like Im going back to Windows... Or maybe try Unreal... I dunno...
     
  11. senkal_

    senkal_

    Joined:
    May 22, 2018
    Posts:
    86
    Will try to double check this behavior this week. If it's easy to reproduce there is a chance fix will come relatively fast.

    I get your frustration. I sometimes switch to Windows/Mac because of Unity Remote or mobile device profiling(not too stable in Linux yet).
    In the end it is still preview for Linux, can't blame Unity for not having everything working, but it doesn't mean I am happy with Linux state.
    I have no plans to switch to Unreal because I pay for Unity license and I am, in general, happy with the value I get back. Worse case I use Windows/Mac, mostly Mac, since I do it as a business and will use tools which work. So if Linux has issues won't use it, I don't have time to play with tools, it is waste of money.
    Bottom line, I don't think Linux preview is enough to depend on it 100%, but things are improving so I am using it more and more.

    I think Unreal doesn't really support Linux editor, there is something not official but last time I checked it was in much worse state than Unity editor Linux support.
     
    Last edited: Jun 3, 2019
  12. JJ_FX

    JJ_FX

    Joined:
    Mar 19, 2015
    Posts:
    76
    Yeah... so yesterday I installed officially supported Ubuntu 18.04. And having exactly same problem.

    Unity remote worked once or twice. And then nothing... eh...

    Well this was a fun week with Linux. Going to miss it, its fast and highly customizeble. But to use it as a tool for work.... A JOKE!!! (at least for Unity)
     
  13. yokomenuchi_unity

    yokomenuchi_unity

    Joined:
    Jul 17, 2020
    Posts:
    2
    This worked for me, using Unity 2019.4, Ubuntu 20.04 and Unity Remote 5 on the phone:
    note: It doesn't matter whether the phone or pc is powered up first.

    - assumes you've already done this on your ubuntu pc:
    - unity> Edit> Project Settings> Editor> Device
    - set to: 'Any Android device', then back it out to main screen
    - installed adb
    - phone is plugged into pc with a suitable cable

    ------------------
    MAIN STEPS:
    ------------------
    -> on your android phone:
    - reboot:
    - force-stop Unity Remote, then clear Cache then clear Storage
    - start up Unity Remote

    -> in Ubuntu:
    - reboot or power up
    - in a terminal window:
    -- type 'adb devices': it should return at least one entry for your phone
    -- type 'adb shell': it should drop you into a shell for your phone; if not, then you MUST fix it first (usually by rebooting phone and/or pc). Once you're in the shell, use 'exit' to get back out
    - start Unity Engine, then press ctrl-p once to start 'Play', then again to stop it
    - back in the terminal window:
    -- find and kill off all unity procs (closing Unity might work; I couldn't test it since my Unity would 'freeze' each time I tried to close it)
    --- I used this cmd: kill -9 `ps -ef|grep unity|grep -v mount|cut -d" " -f9`
    -- find and delete your unity lockfile
    -- type 'adb shell' to confirm it works, then exit it. Do NOT skip this step!
    - start Unity again and press ctrl-p to broadcast to unityRemote
    - jump for joy!! :)

    IMPORTANT: this works until you reboot your pc, after which you will need to repeat some or all of the instructions.
     
  14. Panda29

    Panda29

    Joined:
    Jul 4, 2017
    Posts:
    7
    For me, just close the Android Logcat made Unity Remote work as expected again