How we tested an iOS application from under Ubuntu

  • Tutorial


In the company where I work, the time has come for corporate testing our iOS application, and because I have only mako here, and all the other developers and, most importantly, QA work under Ubuntu, <irony> which means they don’t have iPhones </irony>, so I had to come up with a solution to the problem and save myself the pain of handing over my personal iPhone testers.

If you have encountered a similar problem or are simply interested in the topic of sharing one poppy with the possibility of working on it simultaneously, then I ask for a cat.


Apple remote desktop


First we tried www.pieceable.com , the thing is really good, especially with the prospects for the development of the project, because judging by the main one, Facebook bought it, but so far its speed leaves much to be desired, although the idea (if anyone is not familiar with it, then this is the launch of an emulator on a poppy followed by broadcasting pictures to clients) we liked.

Starting with Mac OS X 10.6, Apple Remote Desktop (VNC, in fact, only shhhh ...) supports Multi-user Screen Sharing, and this is exactly what we need, because the main task was not to distract the developer from the iOS workflow who works behind this Mac.

Mac Actions


Settings for Mac OS X 10.8 aka Mountain Lion (for other systems should not differ much):
  1. Create a user, for example, SimulatorViewer;
  2. We go to Settings -> Sharing -> Remote Managment, there we configure Allow access for: SimulatorViewer, there we select at least Observe + Control + Open And Quit Applications;
  3. Click on Computer Settings and select VNC viewers may control screen with password there, and also enter the password for VNC.

This completes the setup of the Mac OS X part.

Ubuntu Actions


To connect to the Mac, we will use the Remmina Remote Desktop Client , which is already present in the standard Ubuntu distribution, as I was told :) I apologize for the “alien” screenshot, now there is no way to make your own:

  1. Connection-> New ...
  2. Protocol: VNC - Virtual Network Computing ;
  3. Server - Mac's IP address (shown on it in the Sharing window and indeed a lot where, adults already)
  4. We enter in the User and Password our data for the user SimulatorViewer, which we created a little higher;
  5. Set Depth to High color (15 bit) , you can do more if the network allows it), the value will not save you from the brakes :)


You can try to join already, the Mac OS X screen should be displayed, while the session of its user at the computer will not be interrupted.

Customize Xcode


It remains only to make the simulator builds of Xcode available to our user. I chose the simplest option by moving the build directory to / Users / Shared /:
  1. We expel the iOS developer from Mac and smoke for 5 minutes, and at this time we climb into the Xcode settings, Locations section;
  2. Select Derived Data: Custom , path / Users / Shared / Xcode / DerivedData ;
  3. In Advanced ... click on the Shared Folder and enter Build ;
  4. We comment on a random line in the programmer's code;
  5. create an executable (!) file /Users/Shared/run.sh with the following contents:
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone\ Simulator.app/Contents/MacOS/iPhone\ Simulator -SimulateApplication blah
    
  6. We notice the traces and leave the computer of the iOS programmer.

An attentive reader will notice the blah identifier, a short explanation: we won’t work without it, we specially set a nonexistent path and then the simulator will ask us to indicate it at startup :)

The resulting system


We already figured out how to connect to the working poppy, it remains to run the simulator in it and begin to mock the programmer.

  1. We ask the iOS developer to build a build for the simulator (!);
  2. We go through VNC to our poppy (I describe the further actions inside the machine that I’ve visited);
  3. Go to Finder in / Users / Shared / ;
  4. Run run.sh , which will open the simulator with a file selection window;
  5. If we have an application called Habrahabr, then the path to it will be like this:
    /Users/Shared/Xcode/DerivedData/Build/Products/Debug-iphonesimulator/Habrahabr.app
    


If everything is done correctly, then the application will start and you can start testing.

Appendix


During testing, I encountered some problems that I will issue as a FAQ:
FAQ
Q: У разработчика iMac 27'' и айфон головного мозга, нельзя ли сделать разрешение поменьше?
A: При работе через VNC Вы можеет спокойно менять разрешение экрана, а так же их конфигурацию. Настройки экрана -> Scaled, 1024x768

Q: На маке 2 монитора, как отобразить только один из них?
A: Просто зайдите в настройки экрана и нажмите Mirror Displays, тогда будет показан только один экран.

Q: При работе ощущаются тормоза, что делать?(
A: Мы перепробовали несколько VNC клиентов и их настроек, но везде присутсвует проблема лагов и медленного «умерания» коннекта, с чем это связано так и не нашли, потому что в целом тестеров устроило. Помогает переподключение.

Q: А что делать пользователям Windows?
A: Тут такое дело (с), что мы не нашли Win компьютера в офисе, но всё сводится к простейшему поиску VNC клиента под Win, который умеет коннектится к Apple Remote Desktop.


Conclusion


In fact, the article is a collective image of Mac VNC + VNC Client + Xcode custom build path + Running Simulator with target application and was written to save you from googling these topics.

Tips to improve the scheme, especially the bottleneck in the form of VNC and its slow operation, are welcome.
Thanks for attention!

Also popular now: