How to retrieve a .app file from the .xcarchive?

2019-08-08 15:47发布

问题:

I am trying to use Appium to automate our mobile app, and I realize that in order to do so we need to specify the path to .app file. However after archiving I get only the .xcarchive file which I don't know what to do next..

My xcode version is 5.1.

Please advise how to proceed, thanks!

回答1:

Two options:

  1. Build an .ipa instead of .xcarchive (Instructions here) Appium's --app arugment accepts .ipa's as well as .app's and even .zip files. (Try pointing it at .xcarchive! I have no idea if it'll work)

  2. Build and Run

    1. go to /Users/blah/Library/Application\ Support/iPhone\ Simulator/7.1/Applications
    2. Find your app
    3. copy the .app file
    4. put it somewhere outside of the simulator directory (so when appium resets the simulator, it will do a clean install of the app)


回答2:

While sheep test's answer works, there is another way. The .app bundle is included inside the .xcarchive file. If you already have a .xcarchive file, follow these steps to get the .app

  1. Navigate to your .xcarchive file in the finder
  2. Right click on the .xcarchive file and select "Show Package Contents" in the popup menu
  3. The finder will switch to showing the contents of the .xcarchive file.
  4. Navigate to Products/Applications
  5. your .app will be located in Products/Applications


标签: xcode5 appium