Configure Appium +ios Real-world environment under Mac

Source: Internet
Author: User
Tags locale install node appium

Mac System: 10.11.6

Xcode:7

appium:1.5.3

Iphone:6 P

1. Build Appium

Android's Environment:

1.jdk

2.sdk

3.appium

4. Configure Environment variables

The environment variables under the Mac are under CD ~/in the root directory of the logged-on user. Bash_profile did not create a

8# Setting PATH forPython3.5  9# The original version isSavedinch. Bash_profile.pysaveTenPath="/library/frameworks/python.framework/versions/3.5/bin:${path}"#配置python3.5  OneExport PATH AExport path=${path}:/users/hanzhao/desktop/sdk/adt-bundle-mac-x86_64-20131030/sdk/platform-tools:/users/hanzhao/desktop/sdk/adt-bundle-mac-x86_64-20131030/sdk/tools:/users/hanzhao/desktop/sdk/adt-bundle-mac-x86_64-20131030/sdk/build-t ools/25.0.0 #配置sdk  -Export android_home=/users/hanzhao/desktop/sdk/adt-bundle-mac-x86_64-20131030/SDK #配饰安卓 -Export JAVA_HOME=/LIBRARY/JAVA/JAVAVIRTUALMACHINES/JDK1.8.0_111.jdk/contents/Home #配置java~

Install python3.5, (Mac comes with Python2):

The package management tool under Mac is Homebrew, so download Homebrew

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"(因为网址会经常变化,多关注官网 http://brew.sh)
安装完以后 ,输入 brew -v 查看版本:

Homebrew 1.1.0

Homebrew/homebrew-core (git revision 1a39; last commit 2016-11-07

Description success

Use it to install pytho3.5

Direct input to brew install python3.5

Enter Python3 after successful installation

The ability to enter the Python edit page is a successful installation

5. Install pip into the python3.5 directory download pip brew install pip

After the download is complete, you can download some Python extension packages with pip such as Appium-python-client

The PIP path I python3.5 is:

/library/frameworks/python.framework/versions/3.5/lib/python3.5/site-packages (can be found with which, Pip xxxx is executed here)

These are some of the android environments

Here's what iOS needs:

Install Xcode7: There is a pit, which is the beginning of the Xcode8 I installed, because when I iOS boot the real machine: reported: Could not find automation.tracetemplate in any of the following locations/applications/xcode.app/contents/applications/instruments.app/contents/plugins/ Automationinstrument.xrplugin/contents/resources/automation.tracetemplate ....

You need to use Xcode's automation to save a copy of the template. But Xcode8 removed automation from Xcode->open Developer tool->instrument. So switch back from Xcode8 to Xcode7 (you can co-exist between installing a Xcode7).

This really toss me for a long time!!

Install node

Brew Install node

Installing Appium

1. Can be installed with terminal

2. Installing with the GUI

I because NPM download speed is too slow so I take the second way, directly from the official website directly download 1.5.3 Mac version directly installed

After installation, start Appium.

点击 红色按钮检查 环境 安装的 是否正常


OK environment basically set up start to get iOS real machine, behind a lot of pits:

First of all, Appium want to use the real machine debugging preconditions:

1. The premise of running Appium on the real machine is that the mobile phone should be registered as a developer mobile phone, so you can see the Developer (Developer) option on the Settings page.

The Enable UI Automation in the developer option is turned on, or it will be error:

Selenium.common.exceptions.webdriverexception:message:u ' A new session could not be created. (Original error:instruments crashed on startup) '

(This error may also be related to the app signature, if you change your phone: just use the phone's signature to recompile an app.) )

2. It must be a debug package for you to install

3. Need to have bundleid looking for development to

4.UDID: Phone ID can be used itools and other software to see, of course, Xcode can also be seen

5.mac can monitor the mobile app package:

Ideviceinstaller-l

Shown below:

It is possible that your Ideviceinstaller version is too low or not, and will not be able to find this Ideviceinstaller

Ok:

Delete the old and download the latest:

Brew Uninstall Ideviceinstaller

Brew Install Ideviceinstaller (Online said to have this brew install--head Ideviceinstaller: I didn't succeed)

It's OK.

Then you may not be able to listen: Ideviceinstaller Could not connect to Lockdownd. Exiting.

Appium will report the error: Install the app failure is probably: Installed XXX app Faile

This time runs: sudo chmod 777/var/db/lockdown/

6. Find the version number of XOCDE, sometimes it will not find the version number of Xcode: run: sudo xcode-select-s/applications/xcode.app/contents/developer/

7. Run the real machine, the test machine can not lock the screen, or will error

Ok these are all the problems I have, and when they are solved, they can run.

The Python startup script is as follows: from appium import webdriver desired_caps[' platformname ']= ' iOS ' desired_caps[' platformversion '] = ' 9.3.5 ‘
desired_caps[' bundleid '] = ' Com.wuba.zhuanzhuan '
desired_caps[' app ' = Os.path.abspath ('/users/a58/library/developer/xcode/deriveddata/build/products/ Debug-iphoneos/zhuanzhuan.app ') | keywords | description | example |
|----|-----------|-------|
| ' Automationname ' | The automated test engine you want to use | ' Appium ' (default) or ' Selendroid ' |
| ' PlatformName ' | You want to test the phone operating system | ' IOS ', ' Android ', or ' Firefoxos ' |
| ' platformversion ' | mobile OS version | For example: ' 7.1 ', ' 4.4 ' |
| ' devicename ' | Using the type of phone or simulator type | ' iphone Simulator ', ' IPad Simulator ', ' iphone Retina 4-inch ', ' Android Emulator ', ' Galaxy S4 ' ', and so on. On IOS, the value of this keyword must be one of the available device names that you get using ' instruments-s devices '. On Android, this keyword does not work at this time. |
| ' app ' | '. The local absolute path or remote path where the IPA ' or '. apk ' file is located, or it can be a '. zip ' that includes either. Appium will first try to install the path corresponding to the application on the appropriate real machine or simulator. For Android, if you specify ' app-package ' and ' app-activity ' (see below), then you can not specify ' app '. * * will conflict with ' browsername ' * * | For example '/abs/path/to/my.apk ' or ' Http://myapp.com/app.ipa ' |
| ' Browsername ' | The name of the mobile Web browser that requires automated testing. If you are automating your application, the value of this keyword should be empty. |ios system can be used ' Safari ', Android system can use ' Chrome ', ' Chromium ', or ' Browser '. |
| ' Newcommandtimeout ' | Sets the command time-out, units: seconds. When the timeout is reached and the new command is not received, Appium assumes that the client exits and then ends the session automatically. | like ' 60 '
| ' AutoLaunch ' | Appium whether the app needs to be installed and started automatically. The default value ' True ' | ' true ', ' false ' |
| ' Language ' | (sim/emu-only) Set the language of the simulator (Simulator/emulator), such as: ' FR ' |
| ' Locale ' | (sim/emu-only) Sets the locale of the simulator (Simulator/emulator). such as: ' Fr_ca ' |
| ' Udid ' | Unique device identification for connected physical devices | such as: ' 1ae203187fc012g ' |
| ' Orientation ' | (sim/emu-only) Start test in a set direction mode | ' LANDSCAPE ' (landscape) or ' PORTRAIT ' (portrait) |
| ' Autowebview ' | Translates directly to the WebView context. Default value ' False ', | ' true ', ' false ' |
| ' NoReset ' | Do not reset the app state before the session. The default value ' false '. | ' true ', ' false ' |
| ' Fullreset ' | (IOS) To delete the entire emulator directory. (Android) resets the app state by uninstalling-rather than emptying the data. On Android, this also automatically clears the app under test at the end of the session. The default value ' false ' | ' true ', ' false ' | WD = Webdriver. Remote (' Http://127.0.0.1:4723/wd/hub ', desired_caps) is consistent with the introduction of Android. But in the app, if you're using an emulator, you can use. IPA files only.

Configure Appium +ios Real-world environment under Mac

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.