I had an expectation that you enable USB-debug on Android phone, press “Build and run” in Unity, and the project opens on the phone. I had this expectation based on these two vids https://www.youtube.com/watch?v=gpaq5bAjya8 https://www.youtube.com/watch?v=FWyTf3USDCQ
Followed the setup from them too.
The bug is that, the project doesn’t get installed on the phone, can’t be called. But the built apk, if moved to the phone manually as a file, works fine.
Searching the web only established that 2022.3.LTS (the version I’m using is 46f1) introduced new errors into AR, and ramped up the build time to half an hour. I am new to Unity, and can’t fix the errors. So, any help will be appreciated! Showing errors now, in the order they appeared.
First error
Installation failed with the following output:
adb: failed to install D:\UnityProjects\AR3\AR3.apk: Failure [INSTALL_FAILED_USER_RESTRICTED: Install canceled by user]
UnityEditor.BuildPlayerWindow:BuildPlayerAndRun ()
Second error
DeploymentOperationFailedException: Installation failed. See the Console for details.
UnityEditor.Android.AndroidDeploymentTargetsExtension.UploadAPK (UnityEditor.Android.AndroidBuildProperties buildProperties, UnityEditor.Android.AndroidDevice device, UnityEditor.Android.AndroidDeploymentTargetsExtension+LaunchProgressTaskManager taskManager) (at <2ef16115290e43d1b0a841ac7b4ec3eb>:0)
UnityEditor.Android.AndroidDeploymentTargetsExtension+<>c__DisplayClass15_1.<LaunchBuildOnTarget>b__3 () (at <2ef16115290e43d1b0a841ac7b4ec3eb>:0)
UnityEditor.ProgressTaskManager.Run () (at <e0a2c8363ef54a6393fed120beebdb7a>:0)
UnityEditor.Android.AndroidDeploymentTargetsExtension.LaunchBuildOnTarget (UnityEditor.DeploymentTargets.IDeploymentTargetsMainThreadContext context, UnityEditor.BuildProperties buildProperties, UnityEditor.DeploymentTargets.DeploymentTargetId targetId, UnityEditor.ProgressHandler progressHandler) (at <2ef16115290e43d1b0a841ac7b4ec3eb>:0)
UnityEditor.DeploymentTargets.DeploymentTargetManager.LaunchBuildOnTarget (UnityEditor.BuildProperties buildProperties, UnityEditor.DeploymentTargets.DeploymentTargetId targetId, UnityEditor.ProgressHandler progressHandler) (at <e0a2c8363ef54a6393fed120beebdb7a>:0)
UnityEditor.PostprocessBuildPlayer+<>c__DisplayClass22_1.<LaunchOnTargets>b__1 () (at <e0a2c8363ef54a6393fed120beebdb7a>:0)
UnityEditor.BuildPlayerWindow:BuildPlayerAndRun()
Third error
UnityException: Could not find any valid targets to launch on for Android
UnityEditor.PostprocessBuildPlayer.LaunchOnTargets (UnityEditor.BuildTargetGroup targetGroup, UnityEditor.BuildTarget buildTarget, UnityEditor.Build.Reporting.BuildReport buildReport, System.Collections.Generic.List`1[T] launchTargets) (at <e0a2c8363ef54a6393fed120beebdb7a>:0)
UnityEditor.Android.PostProcessAndroidPlayer.Launch (UnityEditor.BuildTarget target, System.String installPath, UnityEditor.Build.Reporting.BuildReport report) (at <2ef16115290e43d1b0a841ac7b4ec3eb>:0)
UnityEditor.Android.AndroidBuildPostprocessor.LaunchPlayer (UnityEditor.Modules.BuildLaunchPlayerArgs args) (at <2ef16115290e43d1b0a841ac7b4ec3eb>:0)
UnityEditor.PostprocessBuildPlayer.Launch (UnityEditor.BuildTargetGroup targetGroup, UnityEditor.BuildTarget buildTarget, System.String path, System.String productName, UnityEditor.BuildOptions options, UnityEditor.Build.Reporting.BuildReport buildReport) (at <e0a2c8363ef54a6393fed120beebdb7a>:0)
UnityEditor.BuildPlayerWindow:BuildPlayerAndRun()
Fourth error
UnityException: Could not find any valid targets to launch on for Android
And finally, the whole thing concludes with a working apk. Took more than 65 seconds, but I doubt it means something.
Build completed with a result of 'Succeeded' in 65 seconds (64962 ms)
UnityEditor.BuildPlayerWindow:BuildPlayerAndRun ()