Use Calabash-Android to fl ads and calabashandroid

Source: Internet
Author: User

Use Calabash-Android to fl ads and calabashandroid

Calabash-android is a unit test tool used to test the UI. This feature is ideal for advertising apps. This article uses a simple example to teach you how to use calabash-anroid to brush application ads. Code: https://github.com/bigconvience/poker_hu

Before using the examples provided in this article for testing, ensure that the test environment is installed. For more information, see install Calabash-Android in Windows.

After the code is downloaded, go to the project directory and enter calabash-android run, as shown in:

At this point, the project directory first creates the directory features. This app is a small game for three landlords. Click menu-> ad recommendations to bring up the advertisement, as shown in:



Add the following code to features/my_first.feature to achieve the purpose of advertising scalping:

Feature: Click ads feature    Scenario: I can click menu item to show adsThen I wait for the "PokerActivity" screen to appearThen I wait for 10 secondsThen I press the menu keyThen I wait for 5 seconds        Then I touch on screen 600 from the left and 350 from the topThen I wait for 10 secondsThen I go back

Because the touch coordinate step of android is not defined yet, you can add the file touch_steps.rb in step_definitions. The Code is as follows:

# -- Touch --#Then /^I (?:press|touch) on screen (\d+) from the left and (\d+) from the top$/ do |x, y|touch(nil, {:offset => {:x => x.to_i, :y => y.to_i}})sleep(3)end

Open windows Command Line and set the command line Font: Enter: chcp 65001, Specific can refer to: http://blog.sina.com.cn/s/blog_628e2ab30101ajcg.html

Enter calabash-android run Poker_hu.apk in the command line to start advertising. Then, use shell scripts or batch files to encapsulate the command, and then the advertisement will be automatically flushed. In windows, create run. bat and add the following code:

@echo off:beginstart /b calabash-android run PokerHu.apkping /n 180 127.1 >nul@echo resartgoto begin

Enter run on the command line. The advertisement will be flushed once every three minutes. I hope that the account will not be blocked after the account is refreshed.


Using idioms to advertise can sometimes achieve better results.

Use emotion to attract people
A wine advertisement: there is no absolute thing in the world, only the true taste
Advertisement for a certain coffee shop: Sit down
Use idioms to keep people in mind
A stone store advertisement: Shi Quanshi Mei
Mineral water advertisement: Oral Server
A toothbrush advertisement: perseverance
Impressed by the irony
An advertisement for an electric fan: My reputation is blown out.
Advertisement for a leather shoes store: the world's first thick skin
As the saying goes
Ads from a typewriter company: Do not get acquainted
A refrigerator advertisement: Cool down under a big tree
Example 2:
Advertisement for a moles drug: moles in mandatory (zhi) a drinking material advertisement: Drinking persons)
Advertisement for a mosquito killer: no mosquito in silence (smell) advertisement for a humidifier: wet famous (teacher)
A bicycle advertisement: Happy To ride (ITS) a mug advertisement: Universal cup (tablet)
Advertisement of a washing powder: Clothing perseverance (yi) advertisement of a pair of glasses: yi ming (ming)

Hello, I would like to ask if the current mobile advertising platform (such as android) is illegal because developers use technical means to get profits from cheating?

It is an illegal activity, but the country does not attach importance to it and does not severely crack down on it.
 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.