Flutter - How to debug iOS native codes? - ios

I write flutter codes in Android studio. I using ios native codes to supply platformview integrated in flutter widget tree. But how can I debug iOS native codes?
addition: I am using iPhone simulator to debug?

You can test it by run it from XCode, here you can set breakpoint and have the same iOS native debugging experience.
Luckily run it from XCode is really easy, just open ios directory in the project and press the button to run it.
If you need more specific info let me know and I will answer you.
EDIT :
The project you need to open with XCode is:
For playing it you need to press top-left play button as in the image:

Related

How to run an ipa file from a Flutter app

Hi I'm new to Flutter and I hava specific use case that I don't know if it is possible.
Is it possible to run a IPA file for another app when I press a button in Flutter.
The IPA file comes from a XCode project, so if that is not possible is there any way to convert the XCode code to Flutter.
Is it possible to run a IPA file for another app when I press a button in Flutter.
Do you mean you want to open a different app on pressing a button in your flutter app, if yes, then sorry you can't open any app in iOS however you can do that in android using android_intent plugin.
The IPA file comes from a XCode project, so if that is not possible is there any way to convert the XCode code to Flutter.
If you mean you have an app already written in Swift or Objective-C and you want to convert it in Flutter app, then again sorry there is no way to do that, you'll have to write the code from scratch.
First, an .ipa (iOS App Store Package) file is an iOS application archive file which stores an iOS app. It is kind of binary file and cannot be converted to source code (Dart in Flutter or Swift in XCode)
Second, I think there is currently no way to convert existing XCode project (written in Swift or Objective-C) to Flutter project. You have to manually code in Flutter your self.

Converting a Xamarin.forms iOS app into Xcode app

I am having a problem but can't seem to find the much-needed information online, having trawled through the internet. I have Xamarin.forms iOS app that I want to test. I cannot run iOS in windows so transferred to mac.
To inspect elements in the app, I need to open the app in Xcode or appium inspector, so I created an Xcode project from the source control containing the Xamarin.forms iOS app. I ran the project and the build was successful.
I deployed the compiled app to an iOS simulator and it deployed okay. This is where the problem is - The deployed app open in the simulator as a blank app showing a white screen with only the battery indicator and a clock showing at the top of the blank white screen. The app is not visible.
From research, I read that this blankness is due to the fact that I was trying to open a Xamarin built app in a native Xcode. In this case, how can I convert this Xamarin.forms iOS app into a native Xcode app so I can open it in an Xcode simulator? I will appreciate any helpful input
That is not how it supposed to work, You only need the mac to compile no to run the project. You need to connect your windows machine to the mac using your LAN and just send the code to it to compile it and retrieves back the code ready for you to open it in your windows machine iOS emulator. Then you can debug to inspect your elements as desired.

How to build reactnative v0.45 project to ios realse

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! :)

Can't call menu in iOS simulator using command+D

I've being using iOS simulator for some time and always used command+D for calling debug menu. But now something happend and menu is not appeared after command+D click.
Who knows what may happend with simulator?
I mean this menu
Check if you are under Debug scheme , if you are under scheme, please provide your react native version, 0.43 pre-release version has a bug about this .

Steroids JS build app for XCode

I'm using AppGyver Steroids to create an app. I want to build an iOS build of it so that I can open the app in XCode. With regular PhoneGap I can simply run phonegap build. I do not see this in Steroids. I've run phonegap build in the Terminal, but it doesn't show native elements when I run it in the simulator (from XCode) like navigation bar.
Is this possible with Steroids? Thanks!
If you're planning to use Steroids, you need to use the Steroids Build Service. To create an actual build targeting iOS platforms, please consult their guide on how to do this.
If you just are developing, use the deploy command to get the QR code and scan it with the AppGyver scanner application to load it temporarily to your device. Or if you want to run it in the emulator, start a steroids session from the terminal:
steroids connect
then enter
simulator
once you're in the steroids session and that should start the iOS simulator.
Not sure what you'd need xCode for in this. The beauty of steroids is that there is no iOS specific code for you to maintain (before you start messing with PhoneGap plugins, which is a different ballgame.) You can still open your html pages using xCode if you wish.
If you're asking how to have xCode do this stuff for you, then I could be wrong but I do not think there is a way. I believe the simulator that Steroids starts is the same as the xCode simulator.

Resources