This is a creation in Article, where the information may have evolved or changed.
The tools you need
Set up Proxy
Please refer to: http://www.cnblogs.com/ghj1976/p/5087049.html
Mac under the command line Settings agent:
Export http_proxy=http://127.0.0.1:8787
git config--global http.proxy http://127.0.0.1:8787
git config--global https.proxy https://127.0.0.1:8787
Download Gomoblie Tools
Go get-u golang.org/x/mobile/cmd/gomobile
Gomoblie Init
Install the Android SDK and make sure that ADB is in path.
I directly download the Android Studio, one step, download address:
Https://developer.android.com/sdk/installing/index.html?pkg=studio
The installation directory for the SDK can be found in the configure– SDK Manager of Android Studio.
The ADB command is in the Platform-tools directory under the SDK installation directory, which is the following directory.
/software/adt-bundle-mac-x86_64-20140321/sdk/platform-tools
Add this directory to the PATH setting.
Http://stackoverflow.com/questions/17901692/set-up-adb-on-mac-os-x
ADB commissioning
First we make sure that Android Studio can be debugged on the real machine
And your device is going to be able to use ADB debugging.
My phone is Huawei Glory 6
To open the USB debugging method on the phone, please refer to the following methods:
Http://jingyan.baidu.com/article/f25ef25466fbfc482d1b8272.html
You need to open two settings, such as:
Turn on USB debugging
Open MTP, do not choose this can not be USB debugging.
After these two settings, we can see that the real-machine debugging is available on Android studio.
ADB Real-Machine debugging
The ADB devices command can see the real machine we just fitted.
The number is the same as the number above.
Perform
gomobile install golang.org/x/mobile/example/basic
我们会看见桌面上安装好了这个 basic 应用。
We can see the effect by running the app on the phone.