Question

I know that there are some restricted api's or code that are not allowed to be in your app when you submit it to the app store.

How do you know what they are? Is there a way to check your app before you submit it to ensure you have not used such api's?

It is probably better to avoid this problem at the design stage, than trying to fix it later, so I was wondering if there is any tool in Xcode, or document to determine this.

Was it helpful?

Solution

The way Apple intends for you to do this is to use XCode's Validation feature. When you're submitting an app, you build for achiving (or Archive from the XCode menu). Then, you open up Organizer to see the archive you just created. At this point, you can press the Validate button in Organizer. That will perform a validation, without actually submitting the app. It will tell you if you're using Private APIs. Depending on how you use them, it might identify what the violation is:

Organizer screenshot

There's definitely ways that code can fool this validation step, and "get away" with using Private APIs until the reviewer looks at the bundle. But, as far as I know, those ways would all be intentional methods of hiding Private API usage, and it sounds like you're trying to discover accidental usage.

If you fail this Validation test, then you might want to use something like AppScanner, mentioned in alan duncan's answer. But, for completeness, I wanted to make sure people knew that this Validation step is available in XCode, and checking for Private API usage is one of the things it's doing before you submit (and have to wait a few days to be told what you did wrong). Also, even if you don't use the Validate button in Organizer, but just use Submit, the tool is performing a Validation for you. The only difference is whether the bundle actually gets uploaded to iTunes Connect.

OTHER TIPS

If you stick to documented interfaces as suggested above, you're fine. The only issue is with third-party libraries whose implementation may be opaque to you.

There is a Mac app called AppScanner that scans from private API usage. I have no experience with it, though.

You will get more information on Apple approval process from

  1. get the private API list.
  2. use class-dump to process the Mach-O file, and get the processed string.
  3. use regex to get the interface, class, or method in the string.
  4. match the API to private API list.

then GOT it~

I opened a porject to do this, but because the reason of my company, canceled. very sorry for this.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top