Xcode7 packaging, iOS9 real machine crash, how to solve ?, Xcode7ios9

Source: Internet
Author: User

Xcode7 packaging, iOS9 real machine crash, how to solve ?, Xcode7ios9

Some projects run on xcode7, and the program will crash when packaged and installed on iOS9 device.
If xcode7 is used for compilation and then packaged to the iOS9 device, it is normal. The key is, how can this problem be solved?

A: After the release of iOS9, some apps often crash in new systems, and the official website has also provided many adaptation and changes. To improve user experience. So how can developers adapt their own apps?

The fastest solution must be to compile and package with less than Xcode7. (I have been urging the demand, so I will use the old version Xcode5 to compile... 555)

 

Of course, if you must use Xcode7, you can solve the problem as follows:

(1) about iOS9 network adaptation (HTTP to HTTPS ).

To forcibly enhance data access security, iOS9 will change all http requests to HTTPS requests by default. (HTTPS = HTTP + SSL/TLS + TCP)

There are two solutions to solve the impact of this change:

Solution a: immediately upgrade the company's server to use TLS 1.2 to parse the relevant data;

Solution B: If the server cannot be upgraded or changed, although Apple does not recommend it, you can use. the plist statement states that an insecure network request can still allow the App to access a specified http or even any http.

The following key values must be added to the "info. plist" file under the root directory of the application;Simply and rudely trust all http servers:

<key>NSAppTransportSecurity</key><dict>    <!--Connect to anything (this is probably BAD)-->    <key>NSAllowsArbitraryLoads</key>    <true/></dict>
You can also directly Add the following content to the property list of the info. plist file without using code:

(2) bitcode, an intermediate code of the compiled program. In the future, the Watch application must contain Bitcode. iOS is not mandatory, but Xcode7 will enable Bitcode by default.

Solution a: update the library so that the library contains Bitcode. Otherwise, the following warning will appear;

(null): URGENT: all bitcode will be dropped because '/Users/myname/Library/Mobile Documents/com~apple~CloudDocs/foldername/appname/GoogleMobileAds.framework/GoogleMobileAds(GADSlot+AdEvents.o)' was built without bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. Note: This will be an error in the future.

Solution B: simple and crude. Disable Bitcode.

TAGRETS-> Build Setting, search for "bitcode" in the upper right corner, and change it to "No ";

(3). iOS9 URL Scheme adaptation, introducing the White List Concept

Add a trusted app in info. plist. Otherwise, the following error is returned:

-canOpenURL: failed for URL: "weixin://app/wx9c8771d3c07dfd30/" - error: "This app is not allowed to query for scheme weixin"-canOpenURL: failed for URL: "wtloginmqq2://qzapp" - error: "This app is not allowed to query for scheme wtloginmqq2"

It can be found in the "info. add the "LSApplicationQueriesSchemes" array to the plist file: the url of each field needs to be added by ourselves, for example, the url of the sdk including Weibo is added (the specific application SDK of other parties will be described accordingly ):

(4) enterprise-level distribution

Before iOS9, enterprise-level distribution operations were very convenient. Just click the "trust" button in the App,

After iOS9, the enterprise-level distribution ipa package becomes the same as the dmg installation package on Mac: it cannot be installed by default, and the "trust" button is no longer displayed;

So we run it on our real machine and install it on our mobile phone before opening the app for the first time. Do not trust or trust the certificate as prompted before.

In this case, you need to open the settings above your device-> General-> description file-> trusted enterprise developers in enterprise applications. This is also a new feature of iOS9;

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.