I'm writing an app for Apple's iPadOS that uses an SQLite database. I'm controlling the DB using FMDB. During my development I'm pointing FMDB to my local Mac development folder so that I can interrogate the DB using SQLiteStudio instead of digging it out of the development folders that Apple XCode defaults to. When I deploy the application I'd like to be able to put it on the iPad where the Apple "Files" app can see it. I'd like to be able to back it up using iTunes like I can the database of another app that I've purchased.
My question is how to configure the database location on the iPad to be able to achieve those goals. Right now in XCode development I point to:
let databaseFolder =
"/Users/robertpetruzzelli/Desktop/MyProjects/ManagingYourMoney"
and when I test on the iPad I change the file path to:
let databaseFolder = (NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true)[0] as NSString) as String
which works for the app to see the DB on the iPad, but it isn't visible in the Files app...
Any assistance would be greatly appreciated.
Bob
Well in a round about way I solved my quandry. Using
let databaseFolder = (NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true)[0] as NSString) as String
is the right thing to do, but I needed to do the steps in the link below:
Deploying SQLite DB to iPad app (via iTunes?)
By doing this I could see my app on my iPad in finder and see the file there. I could copy the file to my Macbook Air and work on anything I wanted to investigate there.
Related
I specifically need help getting the app build into my apps. I am so new to the MAC ecosystem. I need to get my app build from my windows 10 box (parallels) running VS2017/Xamarin Forms project uploaded to My Apps. What i have found is helpful if you are using xcode on the mac.
I have read tons of pages and help files and with all of that what I have includes:
created an app in VS2017/Xamarin that runs happily on the emulator from the MAC (MacBook Pro)
purchased the app dev subcription from apple
created a Production certificate (I don't need this yet but I was in there so...)
created a Development certificate
created a key pair from the Dev cert (that show up in the keychain)
created an App Group
created my app's placeholder under My Apps on App Store Connect
added my iPhone to devices via connecting to the Mac getting the UDID from iTunes
created a development provisioning profile for my iPhone (Not sure how this helps my testflight plight)
Assumptions
You must submit for review the same way for both TestFlight and Prod release to the actual store.
You don't need to open the app in xcode outside Xamarin
There is a tool or concept I am missing out on.
For development outside of Xcode, you will want to use Apple's Application Loader App to upload your app to App Store Connect.
As I said in comment to Matt below his correct answer to my actual question above, I needed to get the project right to get to that point.
Here are the more intimate details for the lurkers. I hope this helps some of you.
I was getting, or trying, to get all of this in place manually instead of letting VS do it's work getting this stuff together while I got to coding. FastLane FTW
Open the account management window, go to Tools > Options > Xamarin > Apple Accounts
Add your AppleID
Click on your appleID
Click the add button
Select your id in the lower text area
then add your distro cert. As is proper you deploy to TestFlight as a prod release.
Then get over to to your iOS project properties:
Make sure that your project is outputting an IPA. (Not Beer ;) )
These are my settings that worked. There could be other configurations that work as well.
I never get the automatic provisioning to work. And while this bundle signing settings look like it will not work, it does. I have received my apple approval for beta and users are in testflight.
Also, make sure you update the version of the app in the plist for subsequent releases. This change is not carried through from the AssemblyInfo.cs as one might expect. viola.
If you see this during debug make sure your debug version has Developer (Automatic) set for your debug settings.
FWIW - My VS2017:
While this does not perfectly match the info # https://learn.microsoft.com/en-us/xamarin/cross-platform/macios/apple-account-management?tabs=windows it worked for me. That page was key to the solution and deserves citing. Your mileage may vary.
If I missed something please reach out and I will update this.
I'd like to be able to have my XCUITest application post an image to a server. I've installed the image using the xcrun simctl addmedia command, but I can't figure out to how to access it from the XCUITest class.
I accomplished this by using UITest to access the default photos installed in the simulator Photos library, and then using the SUT to post to the server in question.
The recorder doesn't work inside UIRemoteViews like the photos library. What you can do is setup a ui test and get it to the point where the photos library is open then set a breakpoint and view/print the view hierarchy. That is how I figured out how to select one of the default photos in the iPhone simulator.
let app = XCUIApplication()
let tablesQuery = app.tables
//Get to the camera or library prompt
app.sheets.buttons["Choose From Library"].tap()
app.cells["Camera Roll"].tap()
app.cells["Photo, Landscape, March 12, 2011, 7:17 PM"].tap()
I download and installed some great app from App Store. And I like to see the view hierarchy of the app just for studying.
Is it possible?
How about using a jailbreak iPhone?
It's not possible with Xcode.
But with a jailbroken iPhone you might be able to use Reveal. But I haven't tested it.
I am downloading the Xcode from the app store to check how my websites will look on different devices. I know how to use the iOS simulator but for websites that are already online. Is there a way to check how a website looks like when i have it native on my mac? I mean when i am at the development stage of the website before put it online, is there a way to check it on the iOs simulator?
Thanks
The simulator contains a version of Safari that can access the outside world via your Mac's network connection. So you don't have to do anything — just type in the address as with any other browser.
You can also drag and drop local HTML content (or anything else the simulator's miniaturised suite of apps can handle) directly onto the simulator to preview without uploading anywhere.
I have an OS X app all correctly setup for using iCloud. If I archive the app and save it as an app in the applications folder and run it, it works with iCloud, but if I run it from Xcode, NSFileManager's ubiquityIdentityToken will always return nil. Anyone know what could cause this?
I've resolved this by enabling all apps in iCloud preferences->documents and data. I don't know why this helps as the app I am developing has always been iCloud enabled, but it is working now.