React native Novice Learning route 03 Real Machine debugging

Source: Internet
Author: User


React Native Beginner 03 Real-Computer Debugging (IOS)accessing the development server from a device


With the development server enabled, you can quickly iterate to modify the app and then view the results on the device. The premise is that your computer and device must be in the same WiFi environment.



Open AwesomeApp/ios/AwesomeApp/AppDelegate.m The URL in the change and change localhost to the IP of your computer. Under the Mac system, you can find the IP address of your computer in the system settings/network.



eg


Jscodelocation = [Nsurl urlwithstring:@ "Http://192.168.1.107:8081/index.ios.bundle?platform=ios&dev=true"];


Select your device as the running target in Xcode and click Build and Run.





using offline Packages


When you run the app on a real machine, all JavaScript code and pictures are automatically packaged inside the app. This can be run out of the development server and eventually submitted to AppStore for publishing.



Requires a new version of xcode7.3, no developer account required, only AppleID generate certificates.



Open AWESOMEAPP/IOS/AWESOMEAPP/APPDELEGATE.M Uncomment jscodelocation = [[NSBundle mainbundle] ... This line.



eg


Real-Machine debugging

 
Jscodelocation = [[NSBundle Mainbundle] urlforresource:@ "main" withextension:@ "Jsbundle"];


Depending on the scheme chosen by your app, different offline packages will be generated (debug generates a package with a warning development pattern, and release generates a compressed-optimized package). To modify Scheme, select Product > Scheme > Edit scheme ... in the top menu of Xcode, switch to debug or release in the build configuration option. Only analyze and run are checked in the build.








Baidu Cloud Disk



React Native Technology Exchange Group 127482131, you are welcome to study RN together.



Reprint please keep the article link http://www.reactnative.pw/



React native Novice Learning route 03 Real Machine debugging


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.