-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Add docs on using Bionic with NativeAOT #88817
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,15 +9,15 @@ To build for Bionic: | |
| * Ensure you have [Android NDK](https://developer.android.com/ndk/downloads) for your system downloaded and extracted somewhere. | ||
| * Update your PATH to include `{NDK_ROOT}\toolchains\llvm\prebuilt\{OS_ARCH}\bin`. Replace `{NDK_ROOT}` with the path where you extracted the NDK, and replace `{OS_ARCH}` with your host OS and architecture (e.g. windows-x86_64 or linux-x86_64). Make sure this entry is first in your path - we need to make sure that running `clang` will execute `clang` from this directory. | ||
| * You can either create a new project or use an existing project. For this guide, let's create a new one: | ||
| ``sh | ||
| ```sh | ||
| $ dotnet new console -o HelloBionic --aot | ||
| $ cd HelloBionic | ||
| `` | ||
| ``` | ||
| Note: the `--aot` parameter added `<PublishAot>true</PublishAot>` to the new project. | ||
| * Publish the project: | ||
| ``sh | ||
| ```sh | ||
| $ dotnet publish -r linux-bionic-arm64 -p:DisableUnsupportedError=true -p:PublishAotUsingRuntimePack=true | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are the two properties going away eventually? If not, we should probably at least mention them in this doc. Their names don't make it super clear what they're doing.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The |
||
| `` | ||
| ``` | ||
| * You should have a binary under `bin\Release\net8.0\linux-bionic-arm64\publish`. Copy this to an Android device. Either `adb push` or using some GUI. | ||
MichalStrehovsky marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| * You can probably run it with `adb shell`, but I used Termux: open Termux, give it access to file system by running `termux-setup-storage`. This will give you access to phone storage under `~/storage`. Copy the binary from `~/storage/...` to `~` (internal storage is not executable and you won't be able to run stuff from it). Then `chmod +x HelloBionic` and `./HelloBionic`. You should see Hello World. | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.