-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
12 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,23 @@ | ||
# go-tun2socks-mobile | ||
# go-tun2socks-build | ||
|
||
Demo for building and using `go-tun2socks` on iOS and Android. | ||
Demo for building and using `go-tun2socks` on Android. | ||
|
||
## Prerequisites | ||
## Setup | ||
|
||
* install go (only test under version 1.13.5) | ||
* install gomobile and init with `gomobile init -v` | ||
* Download Android SDK and NDK (only test under SDK 29 and NDK r20b) | ||
|
||
- macOS (iOS) | ||
- Xcode (iOS) | ||
- SDK (Android) | ||
- NDK (Android) | ||
- make | ||
- Go >= 1.11 | ||
- A C compiler (e.g.: clang, gcc) | ||
- gomobile (https://github.com/golang/go/wiki/Mobile) | ||
- Other common utilities (e.g.: git) | ||
|
||
## Build | ||
```bash | ||
export http_proxy=http://127.0.0.1:8087 | ||
export https_proxy=http://127.0.0.1:8087 | ||
export ANDROID_HOME=/path/to/Android/Sdk | ||
export ANDROID_NDK_HOME=/path/to/Android/android-ndk-r20b | ||
|
||
go get -d ./... | ||
|
||
# Build an AAR | ||
make android | ||
|
||
# Build a Framework | ||
make ios | ||
|
||
# Both | ||
make | ||
``` |