How to edit the Xcode Project for Meteor iOS integration? - ios

I want to create an app icon, splash screen, edit the app name, and set some cordova / app settings.
meteor run ios opens up the simulator but doesn't open or the project. Where is that project and does this Xcode project ever get overwritten? I don't want to lose any settings I make.
For example I want to set the app url scheme so I can implement a redirect to the app. I also want to set cordova preferences to disallow over scroll. Typically I would do these things from within the .xcodeproj but where is it and when does it get overwritten / reset?

From what i have seen from the docs and my experience so far
meteor run ios only runs the iOS emulator with your code in it. The code related to this build is in .meteor/local/cordova-build but is temporary and will get overwritten all the time
meteor run ios-device -p yourlocalip:yourlocalport will launch XCode with the cordova-built .xcodeproject, and a local server on your computer. It is intended to make you able to run and debug your code from an actual iPhone device, with the changes you make on your computer to the code repercuted instantly on the iPhone screen. You need your computer and your phone to be on the same Wifi to enable this feature. The code related to this build is in .meteor/local/cordova-build but is temporary and will get overwritten all the time
meteor build /Path/To/Builds/Directory/NewBuild -p yourserverhost:yourserverip will actually create the cordova-built .xcodeproject pointing to your real server at the path you specified. From this project you can customize as much as you want BUT you will indeed loose these settings with a new build...
Except if you use the yourproject/cordova-build-override/ folder !
As described in the offical cordova meteor docs under "Advanced build configuration" everything you put in this folder will overwrite the files created by meteor during its build. So you can configure everything in the Cordova/Phonegap way there. If you were able to configure your features through Cordova usually, you will be able to do it there.
Bonus that I have learned the hard way :
Always destroy the .meteor/local folder before building one of those three things, i got stuck in a state where XCode remembered some of my changes to the .xcodeproject and everything was messed up. After destroying this folder, everything went back to normal :)
hope i helped
Mickael

If you are looking for the path to the Xcode project in your filesystem, it is located at:
/path/to/project/.meteor/local/cordova-build/platforms/ios/<project>.xcodeproj
You'll have to navigate to your project directory and open .meteor because it is a hidden file.
Note: If you want to be able to see hidden files in finder on a mac, then type into your terminal defaults write com.apple.finder AppleShowAllFiles TRUE, and then restart finder. Change TRUE to FALSE to only see visible files.

Related

Custom Expo Development Client for Simulator

I had a specific question about installing a custom expo development client on a simulator, specifically an iOS simulator. I know that there is a way to install an expo build in a simulator (outlined here: https://docs.expo.dev/build-reference/simulators/), but this is just a build and not a development client, which are two very different things. The concept of an expo development client is outlined here: https://docs.expo.dev/development/introduction/. That means there is no Fast Refresh available, and I cannot modify my app in real-time by changing my code. This is a really important feature for me because I need to make sure my app is compatible with all iPhone sizes, and I need to be able to see the changes quickly without having to make a build every single time. Does anyone know how to do this, or if this is currently even possible?
A more detailed explanation of the issue can be found here: https://expo.canny.io/feature-requests/p/custom-dev-clients-for-simulator
Essentially the issue that I had was I did not set up my eas.json file correctly. I needed to change the preview build profile in the eas.json file so that it contained these parameters: "developmentClient": true and "ios": { "simulator": true } I then built my project using the command eas build --profile preview. I then followed the steps of downloading the tar.gz file, extracting the .app file, dragging it into the simulator, and I was able to successfully open the app and connect it to Metro where I could then see live changes.
Like #Raamiz Abbasi said, you can set developmentClient and simulator to true in your eas.json however if you want to go further, you can also use expo-dev-client to create a "custom expo go app" which is basically a customized expo go which you can publish updates to with the eas-update.
Expo Go and this new "development client" are both clients which serve the purpose of displaying your JS bundles. But, with the expo-dev-client you can do cool things like add extra debug buttons into the menu, or run publishes (or eas updates in this case) which would automatically feed into the dev client.
The reasoning for doing this, besides adding extra debug stuff in the debug menu, would be to avoid the pain of only being able to expo publish a "release" build. Right now expo publish builds used with expo go cannot be debuggable.

Run app phonegap with xcode on jailbroken iPhone

I developed an app with phonegap, and I hate to try on a apple device. I've jailbroken my iPhone5s for try my app without pay apple.
I follow this guide, but seems does't work:
On your Jailbroken device install AppSync Unified 5.2-1 (or later)
from AngelXWind’s repo. Don’t use any other AppSync, and if you have
others, be sure to remove them. Open
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/SDKSettings.plist
and change AD_HOC_CODE_SIGNING_ALLOWED to YES. You may need to
duplicate it to the desktop, change it, save it, then drag and drop
back into the original folder because OS X let you edit the file in
place. If XCode was running, restart XCode. Change your Project and
Target settings to “Ad Hoc Code Sign” in Build Settings Tell XCode to
run app on iPhone. At this point XCode will put app on your iDevice,
but can’t debug because it can’t attach to the process. The app will
start then close immediately. You can now manually start the app on
the phone now though. To enable debugging: In your project select
File>New File Property List and create a file called
“Entitlements.plist”. Add “Can be debugged” or “get-task-allow” (both
do the same thing) and set the value to YES. Now change your Project
and Target Code Signing Entitlements (In Build Settings) to
“Entitlements.plist” (you have to type it in). Now XCode can run and
debug the app. Good luck
This is the link of the guide.
When I run app, XCode tell me "Build Success", and on top it says :"Running on Iphone". If I open detail, it say: "Preparing to install " with a loading circle. It's 20 minute that is preparing to install my app.
How can I fix this problem?

Meteor App Can't Run on iOS Device (Mobile Configuration Issue)

I'm having trouble with my iOS build. Not sure what it is.
After running meteor run ios-device command. It launches Xcode, but the "build and run" button is greyed out.
And when i expand the device drop-down, my phone is listed as "ineligible device" and the simulators is not even shown there.
I suspect there's something wrong inside my mobile-config.js file. Because when i remove this file, it runs as expected (but with default settings).
Hope someone can help explain this. I'm very new to both Meteor and iOS. Sending my packages and platform files as well for reference.
I had this issue too. There were one of two things that fixed it:
1) Make sure your project is linked up to your the correct iOS dev team/account & its not set to "none":
2) I had this issue come back again, besides fixing up the above.
So I restarted the computer, logged in and out and deleted the folder over at .meteor/local/cordova-build and ran meteor run ios-device to rebuild it. This was related to the mobile-config file because I changed the name of my app after I ran it the first time. Clearing up the cordova build stuff forced it to rebuild and perhaps this is why it fixe it.
I also deleted the previous app installed on the device (before I renamed the project in mobile-config.js. I did this because I suspected it had trouble installing because of the naming changes.

How to restore my project wisely

So, it started as a simple test, where I had to delete my app from my iPhone (iOS4.3) just to check how the app behaves on a first run. (I am developing to support down to iOS4.3).
After the deletion, I wasn't able to run the app on my iPhone for some reason. The "Active Scheme" would show iOS Device, although I could manually select my own device from the list, the project wouldn't set my device by default. XCode would drop a message from the top saying:
Could not launch “project1” No such file or directory
(/Users/portal/Library/Developer/Xcode/DerivedData/project1-
cfjhjgezzcapwoadaivpptyywptu/Build/Products/Debug-iphoneos/project1.app/project
I went through this SO post (EDIT: Therefore, restarting XCode, iPhone doing clean project, hard resetting my iPhone) but this didn't change anything, except I can now delete the Derived data in Organizer.
I have a working backup at hand though. Thing is it is a bit outdated as I made many changes to the project. I can run the backed up project, and it seems sane as good.
Now my question is how can I merge the files back into the sane project? The XCode project itself has changed a bit, frameworks were put in as well as some settings.
I tried to simply copy the changed files into the old project, but all I get is a SIGABRT upon the first run. I did a FileMerge look, and saw that for some reason my projectAppDelegate.m is non existant in the PBXBuild section of the .xcodeproj file. which I didn't touch. seems like a mess here.
How can I merge the new project to the old one correctly?

Xcode Build and Archive for Enterprise Distribution builds old archive

I'm working on creating an app for in house distribution enterprise level. I've created the app and tested hosting it on my own server and even getting the click to install working. Now though I have some updates to the app, I make the edits and I even see them in the simulator. When I build and archive the app things seem fine, then I go to the archived project in the organizer window, click the share button and distribute for enterprise, I enter details such as the ipa final url and the app title and then ok & save. Then I upload the app to my server and update any links to point to this new app. The click to install still works properly, but it installs the old version of the app. I've even tried this on a new device. Is there some step I'm mission that tells Xcode some version to build? If so, I don't get is how the simulator shows the update fine, but the archive that is built is not showing the latest code. The app I can find in the simulator dirs is 9.4MB in file size, but the one that is saved after build and archive is only 1.4MB (the update involves a lot of added images), so is the build for archive is not even getting the new files?
if a clean won't work, try completely removing the derived data folder.
the default location is in /Users/you/Library/Developer/Xcode/DerivedData . if you haven't played with the DerivedData location in preferences, this is likely where you'll find the sub-folder containing the cache.
when i encounter a situation similar to the original question (retaining items i've deleted, or similarly missing items i've added or holding onto project icons i've changed), i perform a clean on my project, close it, hit Delete… in the organizer, possibly even remove it from the organizer, possibly even remove from disk and then re-checkout from git if you have it under version control in this way, then re-open the project from scratch.
I figured it out and thought I should post it in case it helped someone else.
I cleaned the project.
Build > Clean - not 100% on what "Clean" is supposed to mean/do, but it allowed the project to build from the current files rather than the old files somehow.

Resources