How to change the “Bundle Identifier” within React

2020-05-18 05:07发布

Starting a new react-native project, the xcode-project gots the bundle-identifier "org.reactjs.native.example.XYZApp". XYZ is the placeholder here for my real project name.

Is there any way to change this bundle identifier on react-native side? Sure, I can change it in XCode. But this is not safe because it can be overriden when react-native will recreate the xcode-project, which could happen at any time, as well es when rebuilding the project.

7条回答
smile是对你的礼貌
2楼-- · 2020-05-18 05:52

To update iOS bundle id -

  • From terminal or command prompt navigate to react-native project folder and then go inside iOS folder.
  • enter command Open ProjectName.xcodeproj

This command will open the project in Xcode where you need to update bundle identifier information of the app

To update android package name follow below steps -

  • Update folder structure inside “android/app/src/main/java/” folder based on your new package name e.g "com/companyName/appName"
  • Update package name inside MainActivity.java file
  • Update package name inside MainApplication.java file
  • Update package name inside /android/app/src/main/AndroidManifest.xml file
  • Update package name inside /android/app/BUCK file
  • Update package name inside /android/app/build.gradle file
查看更多
登录 后发表回答