Use go to develop Android app environment settings under MAC

Source: Internet
Author: User
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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.