有空帮你做个合集
/Applications/Xcode.app/Contents/Developer/usr/bin/instruments -t /Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/PlugIns/AutomationInstrument.xrplugin/Contents/Resources/Automation.tracetemplate -D /tmp/appium-instruments/instrumentscli0.trace -w 53c64243179b24ebec384dc8de22d5074175ba05 com.huawei.pushagent.mtn.onsite -e UIASCRIPT "/Users/apple/Library/Application Support/appium/bootstrap/bootstrap-0943baae6b1d6f5b.js" -e UIARESULTSPATH /tmp/appium-instruments 用 instruments 直接运行看看
#9 楼 @313077271 开发证书是可以的。
#4 楼 @313077271 真机端有配置么?
欢迎欢迎
楼主来汇报进展啦 @umbrella1978
发帖还是要遵循规矩的。
他是真机。不过真机是可以运行的。只是你不会。
测试
最后一个图赞~
我是测试回帖的。
这么赞~~~~
你这边指免费或者开源的吧
➜ Downloads aapt dump badging ~/Downloads/ContactManager-selendroid.apk
package: name='com.example.android.contactmanager' versionCode='1' versionName='1.0'
sdkVersion:'5'
targetSdkVersion:'5'
uses-permission:'android.permission.GET_ACCOUNTS'
uses-permission:'android.permission.READ_CONTACTS'
uses-permission:'android.permission.WRITE_CONTACTS'
uses-permission:'android.permission.INTERNET'
application-label:'Contact Manager'
application-icon-120:'res/drawable-ldpi/icon.png'
application-icon-160:'res/drawable-mdpi/icon.png'
application-icon-240:'res/drawable-hdpi/icon.png'
application: label='Contact Manager' icon='res/drawable-mdpi/icon.png'
application-debuggable
launchable-activity: name='com.example.android.contactmanager.ContactManager' label='Contact Manager' icon=''
uses-permission:'android.permission.READ_CALL_LOG'
uses-implied-permission:'android.permission.READ_CALL_LOG','targetSdkVersion < 16 and requested READ_CONTACTS'
uses-permission:'android.permission.WRITE_CALL_LOG'
uses-implied-permission:'android.permission.WRITE_CALL_LOG','targetSdkVersion < 16 and requested WRITE_CONTACTS'
uses-feature:'android.hardware.touchscreen'
uses-implied-feature:'android.hardware.touchscreen','assumed you require a touch screen unless explicitly made optional'
main
other-activities
supports-screens: 'small' 'normal' 'large'
supports-any-density: 'true'
locales: '--_--'
densities: '120' '160' '240'
Error: Could not find a device to launch. You requested 'iPhone 5s (449AC674-9FB8-431E-8617-846161A5587B) (8.1 Simulator)',
又是一个看不懂日志的同学。这是因为你选择了 iPhone 5s (449AC674-9FB8-431E-8617-846161A5587B) 。
然后呢, appium 的 ios.js 里面傻 x 的代码,给你加了一个 (8.1 Simulator)。 然后在你的 instruments -s device 里面返回的一个 devices 数组,一个个去匹配。 结果你返回的是没有 (8.1 Simulator) 的,所以都对不上。这些就悲剧了。所以你就来问问题了。给你看看代码:
这个是加 (8.1 Simulator)
var reqVersion = opts.platformVersion || opts.iOSSDKVersion;
if (opts.iOSSDKVersion >= 8) {
iosDeviceString += " (" + reqVersion + " Simulator)";
}
整个函数是这样的:
IOS.getDeviceStringFromOpts = function (opts) {
logger.debug("Getting device string from opts: " + JSON.stringify({
forceIphone: opts.forceIphone,
forceIpad: opts.forceIpad,
xcodeVersion: opts.xcodeVersion,
iOSSDKVersion: opts.iOSSDKVersion,
deviceName: opts.deviceName,
platformVersion: opts.platformVersion
}));
var isiPhone = opts.forceIphone || opts.forceIpad === null || (opts.forceIpad !== null && !opts.forceIpad);
var isTall = isiPhone;
var isRetina = opts.xcodeVersion[0] !== '4';
var is64bit = false;
var deviceName = opts.deviceName;
var fixDevice = true;
if (deviceName && deviceName[0] === '=') {
return deviceName.substring(1);
}
logger.debug("fixDevice is " + (fixDevice ? "on" : "off"));
if (deviceName) {
var device = deviceName.toLowerCase();
if (device.indexOf("iphone") !== -1) {
isiPhone = true;
} else if (device.indexOf("ipad") !== -1) {
isiPhone = false;
}
if (deviceName !== opts.platformName) {
isTall = isiPhone && (device.indexOf("4-inch") !== -1);
isRetina = (device.indexOf("retina") !== -1);
is64bit = (device.indexOf("64-bit") !== -1);
}
}
var iosDeviceString = isiPhone ? "iPhone" : "iPad";
if (opts.xcodeVersion[0] === '4') {
if (isiPhone && isRetina) {
iosDeviceString += isTall ? " (Retina 4-inch)" : " (Retina 3.5-inch)";
} else {
iosDeviceString += isRetina ? " (Retina)" : "";
}
} else if (opts.xcodeVersion[0] === '5') {
iosDeviceString += isRetina ? " Retina" : "";
if (isiPhone) {
if (isRetina && isTall) {
iosDeviceString += is64bit ? " (4-inch 64-bit)" : " (4-inch)";
} else if (deviceName.toLowerCase().indexOf("3.5") !== -1) {
iosDeviceString += " (3.5-inch)";
}
} else {
iosDeviceString += is64bit ? " (64-bit)" : "";
}
} else if (opts.xcodeVersion[0] === '6') {
iosDeviceString = opts.deviceName ||
(isiPhone ? "iPhone Simulator" : "iPad Simulator");
}
var reqVersion = opts.platformVersion || opts.iOSSDKVersion;
if (opts.iOSSDKVersion >= 8) {
iosDeviceString += " (" + reqVersion + " Simulator)";
} else if (opts.iOSSDKVersion >= 7.1) {
iosDeviceString += " - Simulator - iOS " + reqVersion;
}
if (fixDevice) {
// Some device config are broken in 5.1
var CONFIG_FIX = {
'iPhone - Simulator - iOS 7.1': 'iPhone Retina (4-inch 64-bit) - ' +
'Simulator - iOS 7.1',
'iPad - Simulator - iOS 7.1': 'iPad Retina (64-bit) - Simulator - ' +
'iOS 7.1',
'iPad Simulator (8.0 Simulator)': 'iPad 2 (8.0 Simulator)',
'iPad Simulator (8.1 Simulator)': 'iPad 2 (8.1 Simulator)',
'iPad Simulator (8.2 Simulator)': 'iPad 2 (8.2 Simulator)',
'iPad Simulator (7.1 Simulator)': 'iPad 2 (7.1 Simulator)',
'iPhone Simulator (8.2 Simulator)': 'iPhone 6 (8.2 Simulator)',
'iPhone Simulator (8.1 Simulator)': 'iPhone 6 (8.1 Simulator)',
'iPhone Simulator (8.0 Simulator)': 'iPhone 6 (8.0 Simulator)',
'iPhone Simulator (7.1 Simulator)': 'iPhone 5s (7.1 Simulator)'
};
if (CONFIG_FIX[iosDeviceString]) {
var oldDeviceString = iosDeviceString;
iosDeviceString = CONFIG_FIX[iosDeviceString];
logger.debug("Fixing device. Changed from: \"" + oldDeviceString +
"\" to: \"" + iosDeviceString + "\"");
}
}
logger.debug("Final device string is: '" + iosDeviceString + "'");
return iosDeviceString;
};
所以,基本上你只要在 Force Device 那里扔个字符串 iPhone 就可以了。
#7 楼 @huangcheng 你真是一塌糊涂,头像没有头像,发帖也不遵守规矩。 你怎么做测试的啊?
#7 楼 @huangcheng 这个 app 的链接给我看看
JAVA_HOME 指向 jdk
#22 楼 @anonymity 收费的娃~