I've managed to get the ios simulator to run my app, my app takes a command line argument supplying a path to load data files from on my mac, this works ok launching the simulator from xcode but when I run the simulator from command line it returns unable to find the first file I load in code:
Terminal Output
cannot open -RegisterForSystemEvents/myconfigdata.txt"
My command line is:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone\
Simulator.app/Contents/MacOS/iPhone\ Simulator -SimulateApplication
myios.app/myios --family ipad --args "/Users/chris.x/mydatapath/"
I'm passing the path I use in xcode with the --args parameter
Any ideas?
TIA
Related
I can open one of my Xcode project in Xcode and add Application supports iTunes file sharing=Yes to plist with Xcode and through Xcode directly, Now I was wandering if this work code be done completely via Terminal as well?
My Goal is type a command in Terminal that does the same work for plist just with Terminal and without opening Xcode program and doing it manually just with Terminal command. For example I have a random Xcode project saved on my Desktop, and since Xcode is accessible via Terminal, I want make this work.
As #Sweeper already answered you should got to the path of your .plist file and then write the following command:
vim Info.plist
This will open an editor which then you need to click on "i", then input the following line into the main tag:
<key>UIFileSharingEnabled</key><true/>
Then click "esc" then ":" then "w" then "q" and finally "Enter" and you are done.
Before the Capacitor v3 update I was able to run the command
ionic cap run ios -l --external
and it would open the xcode from where I used to select my simulator and run the app. I was able to see all the console.log outputs in the xcode window.
However now with v3 update the same command does not open the IDE. Instead it asks for simulator options. When I select one it opens the simulator directly without the IDE. In this case where can I see the console.log outputs?
Thank you
This is the new default behaviour of Capacitor v3. You can add the --open option to open XCode like it did in v2:
ionic cap run ios -l --external --open
https://ionicframework.com/docs/cli/commands/capacitor-run
I am trying to clear app's data from several emulators, in a loop inside a bash script.
Doing so from the terminal indeed clears the app's data, but doing so from a bash script will also uninstall the app from the emulator and close the emulator's window (UI).
I don't want my app to be uninstalled as i need to test it.
Is there a reason that this command works differently when executed from terminal vs. when executed from bash script? When executing from a script against a real device it works perfectly as it should - clear the app's data without uninstalling the application from the device.
I found the answer.
When the emulator is open (with GUI) - the command will work as it should, that is clear the app's data.
When the emulator is open without GUI - the application will also get uninstalled.
How does one invoke a command line tool from an app? I'd like to package the app with the command line tool and be able to launch it when the app launches.
When I try to use
func openCommandLineTool() {
NSWorkspace.shared.open(URL(fileURLWithPath: "/filepath/"))
}
It tells me the application does not have permission to launch the command line tool.
My goal is to have an app that only launches the command line tool. How can I build this command line tool into the app? Is it possible?
I solved this by going to the .entitlements file within Xcode and selecting 'NO' for both 'App Sandbox' and 'com.apple.security.files.user'.
Is there any terminal command that can be used to achieve this?
I know xcodebuild install -configuration can compile our xcodeproj from terminal without launching from Xcode, however the compilation files are under iOS but not in the iPhone simulator. I'm hoping one of you smart-folks can help me out.
Hey, i found out that you can do it with:
xcodebuild -configuration Release -sdk iphonesimulator2.2
This makes a simulator build with version 2.2 ( you can use xcodebuild -showsdks to list what u have avail ). I'm stuck with a problem of trying to get it to launch on the phone. xcodebuild -install doesn't seem to do anything for me :S
Any assistance?
Please see the following github project (search for iphonesim)
This will allow you to launch the iphone simulator from the command line.
(Sorry, it won't seem to let me post a valid URL in this answer)