Skip to content

weamylady2/iOS_remote

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

90 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

iOS_remote

iOS Remote Real Machine

Combine WebDriverAgent and ios-minicap

Language

English, 中文

Platform

Limited in Mac

Features

  • Launch iproxy when start
  • Create http proxy for WDA server
  • Add the missing Index page
  • Support Package management API
  • Support launch WDA
  • iOS device remote control
  • Based on Java

Requirements

  • brew install libjpeg-turbo (>=1.5 is required)
  • Xcode (for the Frameworks)
  • cmake
  • OS X Yosemite (10.9) or higher
  • iOS 8 or higher
  • Lightning cable. See the list of devices.
  • fetch all dependencies with Carthage
  • build Inspector bundle using npm
  • Eclipse IDE for Java EE Developers
  • JavaSE (1.6) or higher
  • Tomcat (7) or higher
  • libimobiledevice
  • ideviceinstaller
  • usbmuxd

Other Help Document

How to install ios-minicap

How to install WebDriverAgent

WebDriverAgent Q&A

Eclipse Import Maven Project

Configure Tomcat9 In Mac

Install

1、Install support

brew install usbmuxd
sudo brew update
sudo brew install libimobiledevice
sudo brew install ideviceinstaller

2、git clone

$git clone https://github.com/openstf/ios-minicap.git
$git clone https://github.com/facebook/WebDriverAgent
$git clone https://github.com/weamylady2/iOS_remote

or

$git clone https://github.com/yxys01/iOS_remote

3、Configure ios-minicap

$cd /Users/yourname/ios-minicap-master

4、Configure WebDriverAgent

$cd /Users/yourname/WebDriverAgent

5、Configure iOS_remote

iOS_remote is a maven project.

  • Open iOS_remote in Eclipse

    Open Eclipse

    Import->Maven->Existing Maven Projects->Next->Browse(iOS_remote's path)->Finish

  • Change Config

    In iOS_remote

    Java Resources->src/main/resource->config.properties

    In config.properties

    change code(change three parameters:minicapPath、wdaPath、bashPath)

minicapPath=/Users/yourname/ios-minicap-master
wdaPath=/Users/yourname/WebDriverAgent
bashPath=/Users/yourname/ios_remote/src/main/resources
wdaPort=8200
minicapPort=12345

Change the three parameters into your project path

6、Change and Rebuild ios-minicap

In order to reduce the pressure of MAC, we need to reduce the frequency of sending imgs from minicaps.

Go to the ios-minicap folder, and Edit the "src/minicap.cpp", Add a method:

static void sleep_ms(unsigned int secs)
{
struct timeval tval;
tval.tv_sec=secs/1000;
tval.tv_usec=(secs*1000)%1000000;
select(0,NULL,NULL,NULL,&tval);
}

Then add a sleep in main:

while (gWaiter.isRunning() and gWaiter.waitForFrame() > 0) {
client.lockFrame(&frame);
encoder.encode(&frame);
client.releaseFrame(&frame);
putUInt32LE(frameSize, encoder.getEncodedSize());
if ( pumps(socket, frameSize, 4) < 0 ) {
break;
}
if ( pumps(socket, encoder.getEncodedData(), encoder.getEncodedSize()) < 0 ) {
break;
}
sleep_ms(50);
}

Next step is rebuilding ios-minicap, runing the build.sh in ios-minicap folder:

$ ./build.sh 
mkdir: build: File exists
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/waterhuang/Downloads/ios-minicap-master/build
[100%] Built target ios_minicap

7、Run iOS_remote

  • Open iproxy

    Open one terminal window

$iproxy 8200 8100
  • Run iOS_remote

$cd /Users/yourname/iOS_remote
$mvn tomcat7:run-war
  • Show in browser

    Open the ios remote page by url::http://localhost:8080/ios/

LICENSE

Under MIT