Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
330 views
in Technique[技术] by (71.8m points)

iphone - How To Perform iOS App Validation From the Command Line

Is it possible to perform the local Validation for iOS applications (which can be see in the Organizer under Archives) function via the command line?

UPDATE: Just to clarify - the goal here is to eventually make this validation a part of the continuous integration process for my iOS applications.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

You can validate from the command line using the command:

xcrun -sdk iphoneos Validation /path/to/App.{app or ipa}

It's a bit unclear what checks it performs, but presumably it does as least code-signing and icon dimensions.

In addition to local validation, it's possible to perform online validation (but only for IPA packages):

xcrun -sdk iphoneos Validation -verbose -online /path/to/App.ipa

For this to work you need to have your iTunes Connect credentials stored in a special entry on your keychain. To create this entry:

  1. Open the Keychain Access application;
  2. Create a new password item (File > New Password item…)
  3. Keychain Item Name: Xcode:itunesconnect.apple.com
  4. Account Name/Password: Your credentials for iTunes Connect

Online validation seems to be fairly rough, but does all the checks that would otherwise be performed validating an archive from with the Organiser window in Xcode. Sadly it doesn't seem to set a non-zero exit code on failure, which means output scraping to detect errors. My current heuristic for detecting failure is the presence of any output after the Performing online validation... line.

Given the lack of documentation it's almost certainly not supported.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...