(注:项目是HP的,客户在美国,配置文档是给客户看的,所以用的E文,也懒得翻译了,见谅)
Test Environment
Mac and IOS environment
Mac mini: OS X 10.10.3
IOS devices: iPhone 5S 8.0
Software environment
JDK 1.8.25
XCode 6.3
Appium 1.3.7
HP ePrint IOS App 5.7.0.181
Apple developer accountrequirement
IOS Develop Permission. $99 per year.
Xcode Account Setup
Create a developer account onApple web site, and then login Xcode with the account.
Xcode -> Preferences -> Accounts -> Click ‘+’ toadd a new account -> Add the developer account.
Download the certificates and save it into local disk. It’scertSigningRequest type file.
Create App ID.
Input any string in App ID Description failed, select “WildcardApp ID”, input “com.hp.*” in bund ID field, and then click Continue save it.
The App ID means a project name, so the created App IDshould matches the tested iOS app bundle ID, but we cannot create the explicitApp ID, such as ePrint “com.hp.com.HPePrintHome-n-Biz”, So we need create awildcard App ID, such as “com.hp.*”, it means the App ID works for all the iOSapp which bundle ID’s prefix is “com.hp.”.
iOS device Setup
Select device tab and click “+” button, create device Nameand input the UUID and save it.
Get UUID from Xcode, open Xcode -> Window -> Devices-> select the connected device via USB, the Identifier is the UUID.
Generate ProvisioningProfiles.
Click “+” button to open “Add iOS Provisioning Profile”page. Select “iOS App development”and click “Continue”.
Select the created App ID just now and click “Continue”.
Select the created certificates just now and click “Continue”.
Select the new registered iOS device and click “Continue”
Create a profile name and click “Generate” button.
Download the provisioning profile and save it into localdisk.
Re-sign IOS App
1) First extract HPePrint.app fromHPePrint.ipa
2) Generate “entitlements.plist”file and put it into the app folder.
The file contents should be, and open the file correct with Xcode.
<plistversion="1.0">
<dict>
<key>get-task-allowkey>
<true/>
dict>
plist>
3) Use the below command to re-sign the app.
Open a terminal and go to the app folder, execute below command.
codesign -f -s "iPhone Developer: XXXX" ./HPePrint.app/ResourceRules.plist HPePrint.app --entitlements entitlements.plist
The parameter “iPhone Developer: XXXX” can be found inKeychain Access.
Appium and iOS Device Setup.
1) iOS setup
iOS device –> settings -> Developer -> Turn on “EnableUI Automation” option
2) Install provisioning profileand re-signed app into iOS device.
Open Xcode -> Window -> devices -> click settingbutton below and open “Show Provisioning Profiles”
Click “+” to add the provisioning profile into the iOSdevice.
Return device window and click “+” to select the re-signedapp and install it into device.
3) Appium setup
The parameter BundleID can be found in Xcode.
Launch Appium Inspector
Open Appium -> click Start -> click Appium Inspector
Environment was ready if the Appium inspector launchedsuccessfully in Mac and the App launched successfully in iOS device.