Phonegap+xcode MAC OS Environment setup

Source: Internet
Author: User

This blog post shows you how to configure the PhoneGap development environment in Mac OS.

Configure a variety of development environments:

1.Java JDK

Jdk1.7.0_80

2.Android SDK

1. Start the terminal Terminal Tool 2. Enter the CD ~/into the current user's home directory 3. Create: Touch. Bash_profile4. Open and edit: opening. Bash_profile5, writing the following in the file: Export path=$ {path}:/users/sxpmg/application/android-sdk-mac_x86/tools:/users/sxpmg/application/android-sdk-mac_x86/ Platform-tools Where:/users/sxpmg/application/android-sdk-mac_x86/tools is not fixed, it points to the tools directory of the Android SDK,/users/sxpmg/ Application/android-sdk-mac_x86/platform-tools points to the Platform-tools directory of the Android SDK and is subject to availability. This is only the path that I used when I configured it. 6. Execute the following command: source. Bash_profile 7, verify: Enter ADB carriage return. If command not found is not displayed, the command is valid and the environment is set to complete.

Specifically how to configure environment variables in Mac OS, refer to: http://www.cnblogs.com/lee0oo0/archive/2013/06/10/3131341.html

3.ANT Packaging Tools

apache-ant-1.9.7
http://ant.apache.org/bindownload.cgi

4.Xcode (Androidstudio)

5.node.js

https://nodejs.org/en/

Configuration of various environment variables

Export Path=${path}:/opt/apache-ant-1.9.7/bin

Installing PhoneGap

Start the terminal terminal tool

Mac use: sudo npm install-g phonegap

Mac use: sudo npm install-g Cordova

Reminder: This time will be longer, I probably installed a 20 minutes or so, so this step needs everyone to wait patiently.

Start creating an iOS app for PhoneGap

This step is in fact consistent with the creation of Windows, just a different build platform. So this is not the right way to talk.

Go to the project directory you want to create, and then create the PHONEGAP project. $ Cordova Create Hello Com.example.hello HelloWorld after you enter this command, the Cordova program will help you build the Hello folder, which is the PHONEGAP environment. Create a Xcode project file. To compile the app is definitely to use Xcode, do not install to go to the App store download it. $ CD hello$ Cordova Platform add iOS you'll see the iOS folder in platforms after you go to the subdirectory with the Finder, and then you'll run the project compilation.

Let's talk about what the previous post didn't say, how to invoke many systems, such as cameras, system information, file operations, and so on, or a third-party developer's plugin?

Basic device information (device API): (Equipment information plugin) $ Cordova plugin add org.apache.cordova.deviceNetwork Connection and batter Y Events: (Network connection plugin) $ Cordova plugin Add org.apache.cordova.network-information$ Cordova plugin add Org.apache.cordova.battery-statusaccelerometer, Compass, and geolocation: (gyroscope) $ Cordova plugin Add org.apache.cordova.device-motion$ Cordova Plugin Add org.apache.cordova.device-orientation$ Cordova plugin add Org.apache.cordova.geolocationCamera, Media Playback and Capture: (Camera photo recording, etc.) $ Cordova Plugin Add org.apache.cordova.camera$ Cordova Plugin Add org.apache.cordova.media-capture$ Cordova plugin add org.apache.cordova.mediaAccess files on device or network (file API): (Access files) $ Cordova plugin Add org.apache.cordova.file$ C Ordova Plugin Add org.apache.cordova.file-transfernotification via dialog box or vibration: (reminder) $ Cordova Plugin Add Org.ap ache.cordova.dialogs$ Cordova Plugin Add org.apache.cordova.vibrationContacts: (Contact person) $ Cordova Plugin Add Org.apache.cordova.contactsGlobalization:$ Cordova Plugin Add org.apache.cordova.globalizationsplashscreen:$ Cordova plugin add Org.apache.cordova.splashscreenOpen new browser windows (Inappbrowser): $ Cordova Plugin Add Org.apache.cordova.inappbrowserDebug console:$ Cordova Plugin Add org.apache.cordova.console

At this point, the development environment under the Phonegap+xcode Mac OS is built. I wish you all a smooth completion of the environment configuration.

Thanks

Jack

Phonegap+xcode MAC OS Environment setup

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.