Launch an application on the iOS simulator with using command line - iphone

Good Morning,
I am trying to launch an application on the iOS Simulator with command line so i put this command in the terminal:
open `xcode-select --print-path`/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone\ Simulator.app
With this command, the simulator is launched. My question is how can I start an application from the terminal?

I have used WaxSim (referenced in rog's comment) and it works pretty well. You can find it at https://github.com/square/WaxSim. For what it's worth, there have been no commits for something like two years and there are a number of open pull requests.
Recently I have started using ios-sim which can be found at https://github.com/phonegap/ios-sim. It looks like (currently) it is active and seems to have more functionality. So far, I haven't had any problems with it (although I have not used it in anger yet).

I do not have enough reps to write it as comment.
ios-sim is used by Facebook and lot of other companies for running automated tests and launching stuff via commandline into iOS simulator.
You can download it from the git repo, just open it in XCode and build it.
The executable will be generated in the Build>products folder.
(For XCode 6 ~/Library/Developer/Xcode/DerivedData/ios-sim-xxxxxx.../Build/Products/)
https://github.com/phonegap/ios-sim
Here is a command to run the .app in iOS6 simulator:
ios-sim launch ./MyApp.app --devicetypeid "com.apple.CoreSimulator.SimDeviceType.iPhone-6"

Related

Got the "Error launching application on" after flutter run

I am flowing the official tutorial to install flutter and run the default app on my iPhone Device. After I execute the flutter run, the app is installed and launched on my iPhone but the logs show the bellow error. How do I solve it?
Launching lib/main.dart on My iPhone 6 in debug mode...
Automatically signing iOS for device deployment using specified development team
in Xcode project: XXXXXXXXXX
Running Xcode build...
└─Compiling, linking, and signing... 50.2s
Xcode builds done. 90.1s
Installing and launching... 41.1s
Error launching the application on My iPhone 6. <-- Error Here
It happens that there are some process needed to Flutter plugin correctly run on physical devices. I struggled with that and finally found that the processes idevicesyslog and iproxy were being silently blocked by MacOS.
You may have noticed already a message liked this:
or a similar one for idevicesyslog.
Once I went to System Preferences -> Security & Privacy in General tab and allowed this apps, everything works. Note that this screen shows only the last app that you tried to run. So I'd recommend that you run flutter app with preferences opened so you can (hopefully) see the messages appearing and click allow.
MacOS may warn you one more time about the file being downloaded from the internet. Just click open and you're good.
The error do not show again after reboot the iPhone.
Same error -- Running fine through Xcode, when I ran with flutter CLI, the app would open, but the terminal log output would crash with the error as in the post.
I ran flutter update and simultaneously turned iPhone off and back on. After doing that, the below popup appeared (on mac).
I believe after the install finished, I ran the below (which I ran several times before updating flutter and installing the popup):
flutter clean
rm -rf ios/Pods
flutter pub get
cd ios && pod install && cd ..
run the flutter app using flutter run from command line, then the MacBook will ask for permission to open the app and app runs,
(lldb) warning: libobjc.A.dylib is being read from process memory. This indicates that LLDB could not find the on-disk shared cache for this device. This will likely reduce debugging performance.
Error launching application on device-XXXXX.
Building & Replace with a newest version ios-deploy solved problems list aboved. Flutter SDK bundled a pre-built command ios-deploy in __PATH_TO_YOUR_Flutter_SDK_/bin/cache/artifacts/ios-deploy/, just replace it.
Please reference to: Flutter Error launching application on device issue .

DeviceInfo native module is not installed correctly

So I tried implementing Facebook Login and followed all the steps accordingly. After having errors with FBSDKcorekit/FBSDKcorekit.h' file not found, I decided to pivot over to working on other components.
Lo' and behold, I have this error giving me trouble now. I followed along with this video: https://www.youtube.com/watch?v=rAXVKapP5cM&t=458s where I used the react-native install react-native-fbsdk and react-native link react-native-fbsdk commands in my terminal.
If it helps, I'm getting the following compile error in my terminal:
The following build commands failed:
CompileC /Users/someUser/desiredProject/ios/build/Build/Intermediates/RCTFBSDK.build/Debug-iphonesimulator/RCTFBSDK.build/Objects-normal/x86_64/RCTFBSDKGraphRequestManager.o RCTFBSDK/core/RCTFBSDKGraphRequestManager.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)
I'm not sure if it was the tinkering around with the react-native-fbsdk or making links to it that caused this error. Note my project was working before I was trying to implement Facebook Login and using the link command.
What's going on here?
Thanks in advance for your time and patience.
edit: Also I did not implement any of the Facebook login code yet since I couldn't get a successful build on Xcode.
#kdizzle Make sure you have the right packager running in the terminal, sometimes you may have a packager associated with another react native project running, this happens because when you stop running an xcode RN project, it doesn't stop the packager in the terminal, and when you start/open another RN project in xcode, it simply checks if a packager is running, doesn't check if it's associated with the current project. So make sure you stop all of the packager instances in the terminal and then open the RN project again.
This may happen when upgrading a project to a newer version of react-native. To fix it,
Stop your packager.
Quit your iOS/android simulator.
Reinstall your modules: rm -rf node_modules && npm install
Restart your packager and simulator, e.g. react-native run-ios
I had this issue and it happened when I changed Hardware within the simulator. To fix it I had to kill the packager and run 'react-native run-ios' again. It didn't happen all the time but when it did this fixed it for me!
Another use is in a Brownfield App. Check your iOS and/or Android react-native versions. If they don't match exactly you will see this error screen too.
For example: I had a react native instance running 0.45.1 while Android had 0.45.0 installed. The solution for me was to make sure everything was running the same version.
None of the above answers have worked for me, so I researched the 'react-native' options a little and ended up:
Deleting the iOS and android folders from the app directory altogether
Running 'react-native eject'
Re-running 'react-native run-ios'
After that the iPhone emulator seemed to have no problem with the app.
This problem would appear when React Native libraries in ios project can not found.
I happend to meet this problem when i update my react-native version from 0.42 to 0.44, and cause that a file named RCTConvert+Map disappear in 0.44, so i update my pod.
command: pod update

Can I run IOS app built by ionic2 for a simulation on Windows?

Are there any ways to simulate ionic hybrid apps on Windows 7 without using MacOS or virtual machine such as VMware/virtual box?.
Specifically, I read ionic documents and references and tried to apply sim-ios & sim-deploy on Windows 7. However, on Windows, sim-deploy seems not supported.
and the information I am looking for related to this is pretty much out-dated.
NO..., To simulate a app you need Xcode installed which you cannot on windows, You can get away with browser testing using Chrome built in browsers but that's about it.
I had the same issue when I wanted to Deploy a IOS app on windows

My Ionic app works fine on browser but does not open in my phone

my ionic project works fine with ionic serve --lab ,but while copied the.apk file in build folder to my phone and install the app but blank screen appears ,
Please can anyone suggest what might be my problem
my app is using google maps,key is provieded for both app and browser in index.html
Have you tried running it in the emulator ? Since its much easier to see the error logs . Try ionic emulate android -l or ios -l (whichever OS you are building for) and then once the execution starts run the command consolelogs it will log all the activity and you will have a better understanding about why its not working.
+1 for using Chrome Remote Debugging feature. It give you the same output as you would receive from running you app in the browser.
Additionally, I have found that sometimes if your app is already compiled, the ionic CLI doesnt always copy your current files into the APK, and uses the older cached files instead. If you are banging your head against the wall, run the following commands to make sure you have your latest code in your APK.
ionic platform remove android
ionic platform add android
ionic run android
I suggest you use the Chrome Remote Debugging feature. I encountered the same, and looked for answers to my symptom for hours. Once I connected to the chrome remote debugger, I got the console.log back, and noticed there was a problem in my routing setup.
It was a problem with ionic CLI. I've updated it to the latest and reinstalled all dependencies.

How to install .bar file in Blackberry 10 simulator

I have 1 .bar file which is generated from eclipse plug-in.
Now I want to test that .bar file in Blackberry 10 simulator.
How can I test that Application?
I have installed blackberry simulator 10 Dev Alpha successfully and configured IP Address also.
Please help me. Thanks in Advance.
After signing the bar file please paste the following line into the command line
*
blackberry-deploy -installApp 192.168.177.131 -password 1234 hello.bar
*
I was able to get the playbook simulator working using this tut:
http://blog.joelambert.co.uk/2012/02/07/getting-started-with-phonegap-on-blackberry-playbook/
When you say you're using the Eclipse plug in, do you mean the QNX Momentics IDE (which is The native BlackBerry 10 IDE but based on Eclipse)? If so, here are the steps I take.
If you have the simulator running, make sure development mode is on.
Click the Run Menu -> Run Configurations
Select "Simulator-Debug" for the run configuration (note the simulator needs to run the x86 compiled binary not ARM)
You mention that you have the IP address set up, so the simulator should appear as a target.
I also like to set the auto build option.
Apply these settings and close.
Now run and the IDE should build the code, and deploy it to your simulator.
If you have only the .bar you can use the vnBB10 tool to install the app in the device or simulator. http://forums.crackberry.com/blackberry-10-os-f269/how-get-bb10-hardware-id-sideload-app-bar-file-into-blackberry-10-a-780773/