Appium IOS 运行中遇到的问题

xcode 7.0.1 + appium 1.4.13 + MAC OS 10.11
模拟器:iphone 6 (9.0)

一、首先1.4.13无法Launch,会报错,需要将1.4.8中的/Applications/Appium.app/Contents/Resources/node_modules/appium的node_modules拷到1.4.13相应目录下,考进去后,运行又会出现找不到appium-instruments,想了个办法,再安装一个1.4.13的appium,将这个新1.4.13的node_modules文件夹里面所有文件command+A,全选复制到之前1.4.13相应文件夹中,过程中需要跳过相同的文件,替换已有旧文件。。

http://stackoverflow.com/questions/33080101/appium-failed-to-start-uncaught-error-instruments

二、
Running iOS Checks
✖ Could not detect Mac OS X Version
Appium-Doctor detected problems. Please fix and rerun Appium-Doctor.

解决方法:

修改/usr/local/lib/node_modules/appium/lib/doctor/ios.js里面的内容,如下:
IOSChecker.prototype.getMacOSXVersion = function (cb) {
exec(“sw_vers -productVersion”, function (err, stdout) {
if (err === null) {
if (stdout.match(‘10.8’) !== null) {
this.osVersion = ‘10.8’;
cb(null, “Mac OS X 10.8 is installed.”);
} else if (stdout.match(‘10.9’) !== null) {
this.osVersion = ‘10.9’;
cb(null, “Mac OS X 10.9 is installed.”);
} else if (stdout.match(‘10.11’) !== null) {
this.osVersion = ‘10.11’;
cb(null, “Mac OS X 10.11 is installed.”);
} else {
this.log.fail(“Could not detect Mac OS X Version”, cb);
}
} else {
this.log.fail(“Unknown SW Version Command: ” + err, cb);
}
}.bind(this));
};

https://testerhome.com/topics/1514

Appium IOS 运行中遇到的问题_第1张图片


三、
Error: Command failed: /bin/sh -c ideviceinstaller -u E32E1D9D-9E65-4AEC-820D-A682D2F4FBE7 -i /var/folders/dc/csf8jqqs30z7y1njyn9y2pzh0000gn/T/115920-73966-9atx70/SafariLauncher/build/Debug-iphoneos/SafariLauncher.app
解决方案:

1、https://github.com/budhash/SafariLauncher 下载工程,解压,打开SarafiLauncher.xcodeproj,添加Bundle ID,build工程。(工程导入后会出现问题:NSUInteger’ (aka ‘unsigned long’) to ‘int’,解决方案:将变量secondLeft修改为:NSUInteger)

Appium IOS 运行中遇到的问题_第2张图片

2、在SarafiLauncher文件夹下修改build.sh里面内容为
LASTDIR=`pwd`
rm -rf ./build
xcodebuild -project SafariLauncher.xcodeproj -configuration Debug SYMROOT=build
cd ./build/SafariLauncher.build/Debug-iphoneos/
zip -r SafariLauncher.zip SafariLauncher.app
cd $LASTDIR


3、SarafiLauncher文件夹下开启终端,sh build.sh

4、步骤3成功后,把SarafiLauncher文件夹压缩,压缩后替
node_modules/appium/build/SafariLauncher里面的SarafiLauncher.zip

Appium IOS 运行中遇到的问题_第3张图片


https://discuss.appium.io/t/error-installing-safari-launcher-on-real-device-appium-v1-3-7/3793/2

四、
error: Could not set the device type in Info.plist即/Applications/Appium.app/Contents/Resources/node_modules/appium:缺少.app文件—>解决方案:
将.app.文件复制进/Applications/Appium.app/Contents/Resources/node_modules/appium目录下

五、appium中IOS设置:
1、需要设置app path
2、选择需要的ForceDevice、PlatformVersion
appium中General Setting:
server addres :127.0.0.1 端口号:4723


Appium IOS 运行中遇到的问题_第4张图片

本文是做个记录,有不对的地方望指正。。

你可能感兴趣的:(测试相关)