ReactNative: 8081 port 서버 없이 빌드하기 (react-native bundle)

(글 작성한 시점의 최신 ReactNative ver: 0.40) 일반적으로 ReactNative를 사용하며 개발 시에는 react-native run-android 명령어로 빌드하며 8081 포트를 띄우거나 react-native start 명령어로 바로 포트를 띄워서, script 파일을 인터넷 연결을 통해 가져오게 되어있다. 5.0 버전 이상에서는 adb reverse tcp:8081 tcp:8081 명령어로 붙고 5.0 미만 버전에서는 pc와 동일한 wifi에 붙은 뒤 ip 설정을 해주는 방식으로 서버에 붙는다. - 해당 내용에 대한 ReactNative doc의 설명 On Android 5.0+ devices connected via USB, you can use the adb command line tool to setup port forwarding from the device to your computer: adb reverse tcp:8081 tcp:8081 Alternatively, select "Dev Settings" from the Developer Menu, then update the "Debug server host for device" setting to match the IP address of your computer. 그러나 릴리즈 할 때는 이 방법을 사용할 수 없기 때문에 script 파일을 ①외부 server에 업로드하여 접근하거나 ②프로젝트 내부에 ReactNative bundle을 포함시켜야 한다. 이 포스팅에서는 ②프로젝트 내부에 ReactNative bundle을 포함시키는 방법으로 빌드할 것이다. 일단 curl 명령어를 사용해야 하기 때문에 cURL이 설치가 되어있어야 한다. ( 다운로드 페이지 ) 일반적으로는 다운로드 페이지에서 curl executable > OS 선택 > Gen...