I recently had to install a react native module that needed configuring in Xcode, but I've been using Visual Studio (VS) Code for many months now on my project. So I opened the workspace file in the project's 'ios' folder.
I can not find any of my App.js code or src files while in Xcode. How do I continue my project in Xcode? Or do I need to continue using VS Code, and just run the saved files in Xcode/iPhone simulator?
p.s. I am not using Expo
You wont get any code in your xcode project, while running your app on android or ios the App.js or other react-native code is bundled, so to change or view react-native code use another editor like VS-Code or Sublime text
Xcode is for only Apple products, there is no JS(X) syntax support, eslint and etc. so, i highly recommend to continue your RN app development in another IDE/Editor, which supports JS(X) and many other major features that need for RN development.
Related
I'm currently programming a React Native app (expo) with Visual Studio Code.
For testing I'm using the iOS simulator.
Until now the setup has worked fine. But now I have a problem with debugging my application. When I want to create a new launch.json file, there is no React Native environment in the dropdown list (see picture below).
I already tried to manually add the launch.json file. But when I want to add a configuration there is also no React Native entry available.
Can anyone please help me?
For debugging I installed the React Native Tools Extension (I also tried differnet versions).
Version Info:
macOS Big Sure: 11.3.1
VS Code: 1.61.2
React Native Tools: 1.7.1
The best way for debugging react-native applications is using a react-native-debugger tool, check out the link below for installation and get started with this amazing community-driven tool:
React-Native-Debugger
I am trying to find my Xcode project file inside React Native so I can setup React Native Firebase (https://rnfirebase.io/docs/v5.x.x/installation/ios)
However, I cannot find where the Xcode project file is? Can anyone help.
You can find Xcode project files here:
yourProjectDir/ios/yourprojectname.xcodeproj
If You use cocoapods then you should always use this file:
yourProjectDir/ios/yourprojectname.xcworkspace
If you use Expo or create react native app you will not have an iOS folder as these are abstracted away from you.
If you wish to use a dependency that requires you to edit native code then you need to eject your application. https://docs.expo.io/versions/latest/expokit/eject
From your command line run expo eject and it will build the necessary ios and android folders for you. However there are several ramifications if you eject your app. You should read the above link carefully.
YourRNProject/ios and there you have it inside!
Open your react native folder
you can see ios folder
this folder is what you search for
I'm using the latest reactnative verion 0.45 and I didn't get a clue on the official doc about how to build the ios release.
About how to the running on ios device section of the doc quoted here:
Connect your iOS device to your Mac using a USB to Lightning cable.
Navigate to the ios folder in your project, then open the .xcodeproj
file within it using Xcode.
But there is no ios folder found after running command npm ios. And most StackOverflow answers like this one require a command like react-native-bundle which was not found either.
I have already got Xcode and an app develop member account and Really want to build my first reactnative app to my iphone before I could do more stuff on it.
I know this might be a very newbie question. If someone could just give some guide or throw some docs about this?
I stuck on this problem since a few days too, unless you will not get an ios or android folder any more with React Native 0.45.
You can build your standalone app by using Expo: https://docs.expo.io/versions/v17.0.0/guides/building-standalone-apps.html
As I understand, they build your app for you online, so it takes some time and require an free expo-account, but after it finised, you can download your .apk or .ipa to submit it to Play Store or AppStore.
When you want to add more custom (non javascript) code to your project and edit it in Andoid Studio or Xcode, so you have to eject your from Reative Native: https://github.com/react-community/create-react-native-app/blob/master/EJECTING.md
After that, you can test your App by building for your own in the simulator, with no need of the Expo-App.
Open the ios folder of your project using xcode
Connect your phone and select your phone from the device selection dropdown
Select the first tab in the explorer and go to signing area, select your development team
Click play and it will install the app in your phone on development mode
For Production build, you can do the same. However, you would need to change your scheme to production:
Open scheme menu under product. From the dropdown, look all the way down, you'll find the menu Edit Scheme, select this.
Select the Release scheme, hit close and re-run your project in your phone.
Note: if you are building for release, make sure your target device is Generic iOS Device
Hope it helps! :)
I'm sure it used to be possible to do this but I don't seem to be able to run the Xcode project generated by Titanium in Xcode. The app installs in the simulator and starts but immediately stops with the following runtime error:
Could not find the file app.js
I'm running Xcode 7.2.1 with appc cli 5.1.0 / ti CLI 5.0.5. The app is built with 5.1.2.GA.
Running the app in Xcode would provided access to instruments and perhaps better insight in native level crashes etc.
What you are trying to do isn't officially supported, but it is possible.
First, do a clean build of your Titanium app from Appcelerator Studio (or the command line). Then open the Xcode project from the build/iphone directory.
Next, open Xcode's preferences and go to the "Locations" tab. Click the "Advanced" button under the "Derived Data" field. Set the build location to "Custom" and "Relative to Workspace". Lastly set the "Products" location to build/Products and the "Intermediates" location to build/Intermediates. Click "Done" and close the preferences dialog. You only need to do this once.
You can now build your app from Xcode, but there are a few gotchas:
You cannot clean the Xcode project. You'll nuke all your app resources.
You can only build for the same target as you built the Titanium app for in Appcelerator Studio. In other words, you will probably have issues building the Titanium app for iOS simulator, then try building it for device from Xcode. Don't do this.
Again, this is currently not supported. I'm working on greatly improving this developer experience, but it's going to take a while. In the meantime, I hope the above helps.
A hybrid app was developed using Drupalgap cordova for iOS. The project is named ExampleApp, as followed by a tutorial, and once started in Xcode (5 and 6) the app works well in iOS simulator. Now I need to rename the app to a custom name to put it for submission in the App Store, but once I do that in Xcode, the app breaks. I followed the official Apple Support page to do that and the one here on stackoverflow with no luck. The app is present on iOS iPhone simulator dashboard with the icon and a new name, but once it starts loading the splash screen, it breaks as soon as it loads it. What is the best way to resolve this problem?
Here's what I would do:
use the PhoneGap Command Line Interface to create a new "official" project: cordova create OfficialApp com.official "OfficialApp"
add the iOS xCode project files: cordova platform add ios
install the DrupalGap SDK on top of the empty project
copy the www/app folder from ExampleApp into your new empty project's www/app folder
prepare/build the app from the terminal
test in xCode simulator
Be sure to replace any custom modifications you had to the index.html file of your new Project. More info: http://drupalgap.org/node/193
Each step of the way, I'd recommend doing a prepare/build via the terminal and then launch the app via xCode to verify PhoneGap works out of the box, then DrupalGap works out of the box, then drop your app on top and run it.
If these steps don't work, I'd recommend opening up an issue in one of the queues:
http://www.drupalgap.org/support