Pre locate a file in a flutter iOS project - xcode

I am developing an iOS app with Flutter and use xCode for testing.
To test a function of my app I would like to store a file in xCode which I can then access in the app with a FilePicker.
The definition via pubspec.yaml > assets does not seem to work.
I also tried to define an Assets folder as a subdirectory of ios in shared_preferences_ios.podspec:
Pod::Spec.new do |s|
s.resources = ['Assets/**.*']
end
One solution that works for me is to connect via Xcode simulator to my AppleID and then get the Files via my iCloud account. It works so far. But I would prefer a "code-based" variant.
Is there a way to implement this?

Related

Create and restore snapshot in Xcode 13 just like Android Studio with Android Emulator

I use Android Studio and Xcode to develop Android and iOS apps respectively.
When I use Android Studio, I can use an option to create a snapshot on android emulator. This way I can restore the snapshot and continue the development using the same data that stored in Sqlite database and SharedPreferences.
I use Xcode and want to replicate the behavior do the same process on the iOS simulator because I want to retain data in UserDefaults and the Sqlite database.
I see some options to do that in a very old version of Xcode, but can't find it in the Xcode 13 version.
Is it possible to create and restore a snapshot on Xcode 13 and iOS Simulator just like in Android Studio with Android Emulator ?
If is not possible, there is any other way or workaround to do something similar ?
I found a workaround since I can't find a way to use snapshot with Xcode and
iOS Simulator.
I use the following code in my app:
print("home directory: \(NSHomeDirectory())" )
This code shows where the iOS simulator folder of the app is located
With that information, I can find the database.sqlite file. I can copy and backup the file or edit the info inside direct in the database.sqlite file.
This way I can use the app and restore the database.sqlite when I want to.
After I edit some info in this file, I just need to remember to run the app again using Ctrl+R.
The same is valid with the file that contains the UserDefaults data stored by the app. This file is located inside
HomeDirectory/Library/Preferences/<app_bundle_id>.plist
You can edit and backup the file if you want, but if you modify the file, remember to run the app again with Xcode.

Is it possible to generate .ipa file for iOS without "Apple Developer account" and without an Apple Device?

I'm trying to run the command below but it says "Failed to create provisioning profile. There are no devices registered in your account on the developer website. Plug in and select a device to have Xcode register it."
flutter build ios
Does anyone knows if is possible to build the iOS files without a Apple Device registered?
*I've setted up a VirtualBox with [macOS Catalina 10.15.3] + [xCode] + [Android Studio] + [Flutter] in Windows
It's possible to create an unsigned iOS .ipa without code signing.
Run the Flutter app first to an iOS simulator to generate iOS build on /build/ios.
Create a folder anywhere you like with
the name Payload - note that this is case sensitive.
Navigate
to /build/ios/iphonesimulator and copy Runner.app to the
Payload folder you've created.
Compress the Payload folder with
default .zip format
Rename Payload.zip to Payload.ipa
Installing the .ipa file to an iOS device is a different topic, however.

XCode Archive for app store Submission

i have several apps in the AppStore but now i am struggling with one of the apps submission.
I added to my app the chart module, and i used AMCharts for that, so to make it work, i added the AMChartLibrary project into my project, and everything works fine either usgin the simulator and the device itself for testing, and now I am ready to submit the new version to appstore and then the nightmare starts
When i run the archive to create the file to be submitted, it falls under Other Items instead iOS Apps, this disables the button "Upload to App Store", my best guess is that the AMChart library can be used for MAC and iOS apps, and for some reason the xCode organizer is not identifying it as iOS app...
I know i am missing something, but i am not finding it.
Thanks
Problem solved, i should change the skip install for the subproject under Build Settings.

How can I remove Watchkit from my App?

I want to remove Apple Watchkit from my App until the new version of IOS is released. This is so I can upload releases of the App until we can upload Watchkit based Apps.
I deleted the 2 Folders:
Twoater WatchKit Extension
Twoater Watchkit App
I then deleted the two Targets of the same name.
I built the App successfully.
I then tried to run the simulator and got a LaunchError = 0.
So something somewhere is not correct.
Did I remove the Watchkit in the correct way or is there a better way of doing it to ensure that all config files are properly adjusted ?
What you're doing is quite a bit overboard.
You should just create two separate schemes: one which includes the WatchKit App Extension and App (for testing for iOS 8.2) and one that doesn't include it (for testing with iOS 8.1 and submitting to the store).
You'll need to provide more details on your error running in the sim. See An error was encountered while running (Domain = LaunchServicesError, Code = 0)

How to create an .ipa file out of phonegap 3.5.0 project?

I'm very new to OS X and facing difficulties even in finding the menu options in xcode.
I tried all the resources available online. All I'm trying is to make an .ipa file out of the phonegap project which uses push notifications. I have tried phonegap build this way:
Created .p12 key and development provision file according to the instructions in the following link:
http://www.raywenderlich.com/32960/apple-push-notification-services-in-ios-6-tutorial-part-1
It's not working out. So, I started to use xcode to do it. But I don't find an option to edit scheme anywhere.
Kindly help me.
Change you device from iPhone/iPad in XCode to iOS Device then in the project build menu, select Archive. You will be prompted by Xcode to sign the app and if you don't have provisioning profile Xcode will assign you one.
Follow the archive menu to create an download the packaged IPA.

Resources