-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(cli): enhance Android dev port forwarding, use host IP for android devices, closes #11137 #11185
Conversation
this changes the `android dev` port forwarding (that is actually handled by the `android-studio-script` command - triggered by our Gradle plugin) with some enhancements: - make the whole process more resilient by checking if the port was actually forwarded and rerunning the `adb reverse` command until it tells us the forward is ready - if the `adb devices` list is empty, retry a few times (waiting a few seconds) to tolerate devices being booted - slows down "raw builds" (Build Project Android Studio menu for instance) that shouldn't happen often anyway - if you're running `android dev` you're usually running the app on a device instead of simply testing builds
Package Changes Through 5e2dbbaThere are 5 changes which include tauri with prerelease, tauri-cli with prerelease, @tauri-apps/cli with prerelease, tauri-bundler with prerelease, tauri-macos-sign with prerelease Planned Package VersionsThe following package releases are the planned based on the context of changes in this pull request.
Add another change file through the GitHub UI by following this link. Read about change files or the docs at github.com/jbolda/covector |
i'm only able to test this on the emulators - but the same should apply to physical devices i'm not at home right now and do not have access to my Android device.. |
This still doesn't work on my physical android device. I didn't have any issue with emulators before this PR, only with physical device. I tried with a couple of android devices and the same error persists. This is what I see on the app when opened:
|
ok i'm stealing a phone right now |
I gave up and we're now using the host IP when running on physical devices; the port forwarding isn't reliable and it doesn't even work if the device is connected via wi-fi (though the cause of the reported issue is still unclear to me) |
Android test failed, so won't merge right now. The auditors won't be super happy with this kind of change for the sake of DX but I will create a high prio issue to fix this after release. Should be doable to handle everything over adb tunneling. |
Posting here for visibility, the issue seems to happen with vite projects (only?), vanilla template with tauri's cli built-in devServer works fine with Even though not tested, I assume leptos, yew and trunk based templates work as well since tauri's built-in devServer is a stripped version of trunk. |
this changes the
android dev
port forwarding (that is actually handled by theandroid-studio-script
command - triggered by our Gradle plugin) with some enhancements:adb reverse
command until it tells us the forward is readyadb devices
list is empty, retry a few times (waiting a few seconds) to tolerate devices being booted - slows down "raw builds" (Build Project Android Studio menu for instance) that shouldn't happen often anyway - if you're runningandroid dev
you're usually running the app on a device instead of simply testing builds