React Native常用命令

React Native命令
//查看链接的ios设备
ios-deploy -c

1、确保你的设备已经成功连接。可以终端输入adb devices来查看:
$ adb devices
List of devices attached
"Your device Name" device

运行adb reverse tcp:8081 tcp:8081

react-native run-ios
react-native run-android
react-native run-ios --simulator="iPhone 8"

yarn install

gulp watch
gulp prod

react-native 修改代码刷新后不能更新的问题
react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res
cd android && ./gradlew assembleRelease
android打包
android目录下
./gradlew assembleRelease

清除android 缓存(在android目录下)
./gradlew clean

ProductGroup = 2A18524C22E866A0003F0F8E /* Products */;

distributionUrl=https://services.gradle.org/distributions/gradle-5.4.1-all.zip

android 打包问题
https://www.cnblogs.com/sk-3/p/10720933.html

http://www.bubuko.com/infodetail-2953673.html

/Users/wangkuo/Library/Android/sdk
/Applications/Android Studio.app/Contents/jre/jdk/Contents/Home
/Users/wangkuo/Library/Android/sdk/ndk-bundle

import RNFS from 'react-native-fs'
this.svg.toDataURL((data) => {
let filePath = ''
filePath = ${RNFS.CachesDirectoryPath}/ + this.props.address + '.png'
RNFS.writeFile(filePath, data, 'base64').then((success) => {
Toast.dropDownMsg(translate('saveSuccess'), 'center')
return CameraRoll.saveToCameraRoll(filePath, 'photo')
})
})

react-native bundle --entry-file index.android.js --bundle-output ./android/app/src/main/res/index.androidserver.bundle --platform android --assets-dest ./android/app/src/main/res/ --dev false

react-native bundle --entry-file index.ios.js --platform ios --dev false --bundle-output ./iOS/bundle/index.jsbundle --assets-dest ./ios/bundle

clock_in.ios

react-native bundle --entry-file index.android.js --bundle-output ./android/app/src/main/res/index.androidserver.bundle --platform android --assets-dest ./android/app/src/main/res/ --dev false

处理提示
allowBackup=false
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES"/>
<uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS"
tools:ignore="ProtectedPermissions"/>

RCTActionSheetManager.m // 145行

// [items addObject:data];

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容