Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
332 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 Reply

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...