Recently trying to use React Native to do something, found that the real machine debugging or some pits exist.
IOS Real-Computer debugging
First, you have to make the debug computer and your phone must be in the same WiFi network below
-
Open the files for your IOS projectAppDelegate.m
-
ChangejsCodeLocationtolocalhostyour computer's local area network IP address
-
InXcode, select your phone as the target device and youRuncan
You can open the development menu (reload, debug, etc.) by shaking the device
Android Real-Computer debugging
On your Android device, openUSB debuggingand connect the computer to start debugging.
The method that runs on the real machine is consistent with running on the emulator, both byreact-native run-androidinstalling and running your React Native app.
If not Android 5.0+ (API 21), then there is no way toadb reversedebug, you need to connect to your developer server via WiFi
Let the debug computer and your phone must be in the same WiFi network below
-
Turn on vibrate menu (Shake device)
-
ToDev Settings
-
ChooseDebug server host for device
-
Enter the LAN IP for the debug computer
-
ClickReload JS
Xcode7 error resolution on the operating system
The XCODE7 specifies the real machine to run, the result is reported as follows error:
Undefined Symbols for Architecture arm64: ' _rctsetlogfunction ', referenced from:-[propertyfindertests testrenders Welcomescreen] in PROPERTYFINDERTESTS.O ld:symbol (s) isn't found for architecture arm64 clang:error:linker command failed With exit code 1 (use-v to see invocation)
At first thought of React Native Library of the problem, looked up a bit of information, research, the original in theBuild SettingsetDead Code StrippingasNo(for example) can be solved
React native real-machine commissioning