how to stop app building in xctest? - xctest

I am new to XCTest UI Automation, whenever I run my xctest code it calls main code and starts building app on my iPhone is there any objective C code or settings using which i can make xctest code independent ?
Thanks in advance

If you go to "Target dependencies" for your UI testing target, you can remove the app as a dependency - this will stop the app being built when you're running UI Tests. Be careful though, the xctestrun file expects there to be a .app file for it to install on the device, so you will need to have previously built the app in the same derived data directory that you're building the UI Testing target to.

Related

Can EarlGrey be used as test tool only having ipa file?

Hello Stack Overflow community,
I'm planning to develop a UI test automation for an iOS application.
The problem is that I don't have access to the source code but only the finished ipa file of the app.
Is there a possibility to write UI tests with EarlGrey or do I need the source code of the app?
With Appium it should be possible to write UI tests without the source code.
Thanks a lot in advance!
Original EarlGrey by Google required access to iOS project, you can check here the setup.
The new EarlGrey 2 is actually has a similar concept and you need to have source code to use it.
Appium can use developer-signed .app file on simulator. If you want to run tests on real device you need have developer-signed .ipa file plus re-sign WebDriverAgent with the same iOS developer account.
So technically Appium does not require source code, but you need to have access to iOS developer certificates that been used for build

How does react native compile it's code into native apps?

recently started working with react native and project requires for apps to be build on server. So the theory is that app could be build on request, which means something, lets call this something react native compiler, needs to be on some server which allows me to do this.
For example, this is the location where is react native compiler is "http://example.com/compile", and you have some settings options and button "compile" on that site, and when you click on button, application compiler starts, and after x seconds android and iphone apps are ready to be downloaded. Is this possible?
It is surely possible, although it might be complicated to implement, it all boils down to the level of complexity that you want to achieve (just a build system, an online IDE...).
Each React Native application consists of the JavaScript code and one Android and iOS projects (you can include more platforms through 3rd party efforts, but let's keep it simple). Both the iOS and Android SDKs offer command-line tools for the building functionality. In the case of iOS you have the xcrun command and in Android, the project includes some gradle commands that you can execute. So in general, what you have to do is just execute these commands via your backend when an user requests it.
Essentially what you need is the same kind of setup a Continuous Integration server would, but instead of triggering a build whenever changes are made, the server should build the app on demand, and then send back the result of the compilation to the user. You can read more about CI for React Native here and here, for instance.

How to enable every developer run my xcode project

I had written a static library in objective c. Then I wrote an sample app that show how to run the static library. I want many developers to be able to run this sample app on a real device and not on the simulator(it is a BLE app and it is not possible to operate it on a simulator). How can I do that?
You'd have to publish it on the app store, but really you want to demonstrate the code needed to use your library, so just include the demo Xcode project with the library and developers can run it on their own devices/simulators and change whatever they wish.
This also provides self-documentation on how to integrate your library with their app.

How to reduce the size of Sencha Touch Application?

I am building a Sencha Touch application. Even the most basic application is of size 27 MB. Now I want to commit the code online. The touch folder inside the application is of 20 MB which is way too much.
So how can I compress my application and reduce the size of my application?
use sencha cmd to minify to one js file.
from the application's root in the terminal or command prompt, run "sencha app build production" or "sencha app build testing" dependent on if you want the source code minified also.
Make sure you have sencha cmd installed first.
Also make sure each of your classes is requiring only the source components you need. What you're doing right now is deploying every single line of sencha touch, whereas in reality, if you're not using the carousel component, for instance, you don't need this in your deployed app.
Requiring in the classes you need only, and then building the app file in this way, will give you a nice compact single js file that is many many times smaller.
At first, what do you want is not clear. Why you want to compress the application?
If you want to run it on device, you can minify it using sencha cmd. From within your application folder run this command
sencha app build production
and you can see your app size(build version) will reduce drastically. Further you can make apk and/or ipa with this build version only.

Automated user interface testing in Titanium

How can I create automated user interface tests for a Titanium app? Does the framework include something for this? Are there any helpful third party tools?
Have you looked at titanium-jasmine?
I have never personally used it but ive heard its pretty useful for this type of thing. I'm not sure about its abilities to test actually visual elements.
EDIT:
For testing the user interface and simulating touch events on the simulator or device, just use UIAutomation with the native workflow! Since every Titanium project compiles to an XCode project (which can and should be at least profiled for memory leaks using the native workflow before release to the app store), you can just follow the steps here to write your own tests in Javascript.
As a first step, run your app in the simulator, then got to PROJECT_HOME/build/ and open up the xcodeproj file. Once inside XCode, hold down the "Run" button, click "Profile", which will open up "Instruments" and add the "Automation" widget like in the link I provided!
This is not titanium specific, it can be used for any iOS app and seems like a great tool for every iOS developer, along with Allocators and Memory Leak widgets inside of instruments.
Possibly a better alternative is using Gorilla Logic's free MonkeyTalk. It is a bit more straightforward if your not very experienced with XCode, and it has the benefit of (theoretically) being able to test iOS and Android.